一 基本操作
ComboBox comboBoxSrialFont =new ComboBox ();
comboBoxSrialFont.Items.Add("ASD");
comboBoxAutoGateDownFlg.SelectedIndex = 1; //设置 当前 算选择 的 当前项
byte currindex =(byte) comboBoxAutoGateDownFlg..SelectedIndex;; //当前的索引项 返回 整数类型
string currIndexStr = comboBoxAutoGateDownFlg.SelectedItem.ToString(); //当前索引项的 文本 内容
二 遍历问题
方法1 遍历里面的 内容 string
foreach ( string temp in comboBoxSerilGate.Items)
{
comboBoxSrialFont.Items.Add(temp);
comboBoxSerialLedPage.Items.Add(temp);
}
方法2 遍历里面的 内容 string
for (int i = 0; i < comboBoxSerilGate.Items.Count;i++ )
{
comboBoxSerilGate.SelectedIndex = i;
string value = comboBoxSerilGate.SelectedValue.ToString();
}