Esempio n. 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);
        }
Esempio n. 2
0
 private void TestProgramListBox_DoubleClick(object sender, MouseEventArgs e)
 {
     for (int i = 0; i < TestProgramListBox.Items.Count; i++)
     {
         var rect = TestProgramListBox.GetItemRectangle(i);
         if (rect.Contains(e.Location))
         {
             if (EditTestAt(i))
             {
                 TestProgramListBox.Items[i] = TestProgram[i].GetDisplayText();
                 TestProgramListBox.Refresh();
             }
             break;
         }
     }
 }