private void SetConnectionState(bool state) { _trackBar.Enabled = state; if (!state) { _fan = null; } }
private void _connectBtn_Click(object sender, EventArgs e) { try { _fan = new FanControlHID(); _trackBar.Enabled = true; } catch (Exception ex) { MessageBox.Show("HID Device not found" + ex.ToString()); } }