private void AvailableTestListBox_MouseDown(object sender, MouseEventArgs e) { AvailableTestListBox.SelectedIndex = AvailableTestListBox.IndexFromPoint(e.X, e.Y); if (e.Button == MouseButtons.Right) { if (AvailableTestListBox.SelectedIndex != -1) { BatchAddToolStripMenuItem.Enabled = false; if (AvailableTestListBox.SelectedItem.ToString() == "RX Packet Error Rate (PER) Test" || AvailableTestListBox.SelectedItem.ToString() == "TX Packet Error Rate (PER) Test" || AvailableTestListBox.SelectedItem.ToString() == "Transmit Carrier Wave" || AvailableTestListBox.SelectedItem.ToString() == "Transmit Packets" || AvailableTestListBox.SelectedItem.ToString() == "Receive Packets") //if (AvailableTestListBox.SelectedIndex >= 5) //{ // BatchAddToolStripMenuItem.Enabled = false; //} //else { BatchAddToolStripMenuItem.Enabled = true; } AvailableTestRightClickMenu.Show(Cursor.Position); } } }
private void AvailableTestListBox_MouseDown(object sender, MouseEventArgs e) { AvailableTestListBox.SelectedIndex = AvailableTestListBox.IndexFromPoint(e.X, e.Y); if (e.Button == MouseButtons.Right) { if (AvailableTestListBox.SelectedIndex != -1) { if (AvailableTestListBox.SelectedIndex >= 5) { BatchAddToolStripMenuItem.Enabled = false; } else { BatchAddToolStripMenuItem.Enabled = true; } AvailableTestRightClickMenu.Show(Cursor.Position); } } }