diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index 4173385..2ccf741 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -395,6 +395,8 @@ namespace EduNetworkBuilder btnReset.Visible = false; tbSearchBox.Visible = false; + btnOK.Text = "Test"; + PuzzleInfo pi; string shown_name; string puzzle_name = ""; @@ -437,11 +439,8 @@ namespace EduNetworkBuilder } if (selected != null && selected != "") { - foreach (object one in lbWindowData.Items) - { - if (one.ToString() == selected) - lbWindowData.SelectedItem = selected; - } + if(selectedIndex >=0 && selectedIndex <= lbWindowData.Items.Count) + lbWindowData.SelectedIndex = selectedIndex; } if (lbWindowData.SelectedIndex != -1) { @@ -628,9 +627,9 @@ namespace EduNetworkBuilder //We always add one since we are skipping the loopback device myNetDevice.EditDHCP(lbWindowData.SelectedIndex + 1, this); } - if (MyMode == LBContents.puzzles) + if (MyMode == LBContents.puzzles || MyMode == LBContents.regressiontest) { - //Just like pressing the OK button. We load the map + //Just like pressing the OK button. We load the map / process regression btnOK_Click(sender, e); } UpdateForm(); @@ -700,6 +699,8 @@ namespace EduNetworkBuilder UpdateForm(); } } + if (MyMode == LBContents.regressiontest) + UpdateForm(); } }