示例#1
0
        protected override void OnShown(EventArgs e)
        {
            AvailableTestListBox.Focus();
            AvailableTestListBox.SelectedIndex = 0;
            if (TestProgramOpenEditIndex > -1)
            {
                TestProgramListBox.ClearSelected();
                TestProgramListBox.SelectedIndex = TestProgramOpenEditIndex;

                if (EditTestAt(TestProgramOpenEditIndex))
                {
                    TestProgramListBox.Items[TestProgramOpenEditIndex] =
                        TestProgram[TestProgramOpenEditIndex].GetDisplayText();
                    TestProgramListBox.Refresh();
                }
            }

            if (TestProgramListBox.Items.Count == 0)
            {
                UpButton.Enabled         = false;
                DownButton.Enabled       = false;
                RemoveTestButton.Enabled = false;
            }

            base.OnShown(e);
        }
示例#2
0
 private void TestProgramListBox_MouseDown(object sender, MouseEventArgs e)
 {
     if ((ModifierKeys & Keys.Control) != Keys.Control)
     {
         TestProgramListBox.ClearSelected();
         TestProgramListBox.SelectedIndex = TestProgramListBox.IndexFromPoint(e.X, e.Y);
     }
     else
     {
         TestProgramListBox.SetSelected(TestProgramListBox.IndexFromPoint(e.X, e.Y), true);
     }
 }