cxCheckComboBox1顾名思义,就是CheckBox与ComboBox的组合选择控件
011]设计时添加Item
012]用代码添加Item
02]取已勾选的全部内容文本:
03]取已勾选的内容项:
04]TcxCheckComboBox控件的默认选项,去掉‘None selected’
05]用下拉框第一个数据来填充:cxCheckComboBox1.States[0] := cbsChecked;
06]清空此框:cxCheckComboBox1.clear; 下拉Items还在
01] Item的添加
with cxCheckComboBox1, Properties,items,add do begin Description := 'cccwwercc'; end;
cxCheckComboBox1.Text
procedure TForm13.Button1Click(Sender: TObject); var idx, cnt: Integer; begin cnt := cxCheckComboBox1.Properties.Items.Count; for idx := 0 to cnt - 1 do if cbsChecked=cxCheckComboBox1.States[idx] then ShowMessage(cxCheckComboBox1.Properties.Items[idx].Description); end;
procedure TForm13.Button1Click(Sender: TObject); var AProperties: TcxCheckComboBoxProperties; AValue: Variant; ACheckStates: TcxCheckStates; I: Integer; begin AValue := cxCheckComboBox1.EditValue; AProperties := TcxCheckComboBoxProperties(cxCheckComboBox1.Properties); CalculateCheckStates(AValue, AProperties.Items, AProperties.EditValueFormat, ACheckStates); cxMemo1.Clear; for I := 0 to Length(ACheckStates) - 1 do if ACheckStates[I] = cbsChecked then cxMemo1.Lines.Add('Checked') else cxMemo1.Lines.Add('Unhecked'); end;
04]TcxCheckComboBox控件的默认选项,去掉‘None selected’
procedure TForm1.FormCreate(Sender: TObject); begin cxCheckComboBox1.Properties.EmptySelectionText := ''; end;