コード例 #1
0
        private void LbDevices_DoubleClick(object sender, EventArgs e)
        {
            var listBox = sender as ListBox;

            if (listBox == null)
            {
                return;
            }
            _deviceItem = listBox.SelectedItem as DeviceItem;
            if (_deviceItem == null)
            {
                return;
            }
            tbCurrentDevice.Text = _deviceItem.Text;
        }
コード例 #2
0
 private void FillDeviceList(ListBox listBox)
 {
     listBox.DataSource    = DeviceItem.GetDeviceItems();
     listBox.DisplayMember = nameof(DeviceItem.Text);
     listBox.SelectedIndex = 0;
 }