private void comboBoxDeviceAddress_SelectedIndexChanged(object sender, EventArgs e) { comboBoxCommand.DataSource = null; ArrayList deviceCommandList = dbMgr.GetAvailableCommands(comboBoxDeviceAddress.SelectedValue.ToString()); comboBoxCommand.DataSource = deviceCommandList; }
private void InitializeForm() { dbMgr = new DBManager(); comboBoxDeviceAddress.DataSource = Enum.GetValues(typeof(DeviceAddresses)); if (dbMgr.OpenConfig(configFileName)) { ArrayList deviceCommandList = dbMgr.GetAvailableCommands(comboBoxDeviceAddress.SelectedValue.ToString()); comboBoxCommand.DataSource = deviceCommandList; } for (int i = 0; i < 12; i++) { CustomByteData customBytedata = new CustomByteData(); // // customByteData // customBytedata.Location = new System.Drawing.Point(27, 200 + i * 30); customBytedata.Name = "customByteData1"; customBytedata.Size = new System.Drawing.Size(500, 37); customBytedata.TabIndex = 6 + i; customBytedata.TxtDataDescription = ""; dataBytes.Add(customBytedata); this.Controls.Add(customBytedata); } try { comboBoxCommand.SelectedIndex = comboBoxCommand.Items.Count - 1; } catch { } }
private void FillCommandBox() { dbMgr = new DBManager(); dbMgr.OpenConfig(configFileName); ArrayList deviceCommandList = dbMgr.GetAvailableCommands(comboBoxDeviceType.Text); comboBoxCommand.DataSource = null; comboBoxCommand.DataSource = deviceCommandList; // comboBoxCommand.Sorted = true; }