private void DevicesListBox_MouseClick(object sender, MouseEventArgs e) { Console.WriteLine(DevicesListBox.SelectedItems); var hitInfo = DevicesListBox.HitTest(e.Location); if (hitInfo.Location == ListViewHitTestLocations.None) { return; } DeviceInfoTextBox.Text = _devices[DevicesListBox.SelectedItems[0].Index].ToString(); StatusButton_SetText(); }
public ChooseAudioDevice() { Instance = this; InitializeComponent(); this.MouseDown += new MouseButtonEventHandler(ChooseAudioDevice_MouseDown); this.Closing += new System.ComponentModel.CancelEventHandler(ChooseAudioDevice_Closing); //start load-devices-thread OkButton.IsEnabled = false; DevicesListBox.Focus(); DevicesListBox.Items.Clear(); DevicesListBox.Items.Add("Loading..."); var thread = new Thread(LoadDevices); thread.Start(); }