From 65f14420f72548edce231f7934862b32ef812f4e Mon Sep 17 00:00:00 2001 From: Tim Young Date: Fri, 28 Sep 2018 13:50:33 -0500 Subject: [PATCH] Fix puzzle selection issue --- EduNetworkBuilder/ListBoxWindow.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index eae5f73..b23383d 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -378,11 +378,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) { @@ -788,8 +785,8 @@ namespace EduNetworkBuilder oursettings.ScoreList.Add(TheName); } } - UpdateForm(); } + UpdateForm(); } if (MyMode == LBContents.regressiontest) UpdateForm();