Skip to content

Commit

Permalink
Fix index of SearchComboBox
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Jan 22, 2020
1 parent 48248e0 commit 2196d73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Netch/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -207,7 +208,14 @@ public void AddMode(Models.Mode mode)
private void SaveConfigs()
{
Global.Settings.ServerComboBoxSelectedIndex = ServerComboBox.SelectedIndex;
Global.Settings.ModeComboBoxSelectedIndex = ModeComboBox.SelectedIndex;
if (ModeComboBox.Tag is object[] list)
{
Global.Settings.ModeComboBoxSelectedIndex = list.ToList().IndexOf(ModeComboBox.SelectedItem);
}
else
{
Global.Settings.ModeComboBoxSelectedIndex = ModeComboBox.Items.IndexOf(ModeComboBox.SelectedItem);
}
Utils.Configuration.Save();
}

Expand Down

0 comments on commit 2196d73

Please sign in to comment.