如何在C#中用我的顯示成員是數組的值並且value成員是數組鍵的數組填充組合框?C#填充組合框
string[] RelayTypeArray = new string[4];
RelayTypeArray[0] = null;
RelayTypeArray[1] = "Boiler";
RelayTypeArray[2] = "Valve";
RelayTypeArray[3] = "Pump";
cmb_RelayType.DataSource = RelayTypeArray;
cmb_RelayType.DisplayMember = RelayTypeArray;
cmb_RelayType.ValueMember = ?????
先顯示數組。基本上你的代碼.. – nawfal
通過編寫代碼,也許? – 2012-10-10 15:29:51
您可以使用'DataBinding'例如'ControlID.DataSource = array;' – adatapost