Use BeginUpdate and EndUpdate when editing items in combobox

This commit is contained in:
Travis Nickles 2018-02-07 16:15:58 -06:00
parent f676e6257e
commit 4a29f53694

View File

@ -1944,18 +1944,22 @@ namespace DS4Windows
if (nUDUpdateTime.Value == 1) if (nUDUpdateTime.Value == 1)
{ {
int index = currentIndex; int index = currentIndex;
cBUpdateTime.BeginUpdate();
cBUpdateTime.Items.Clear(); cBUpdateTime.Items.Clear();
cBUpdateTime.Items.Add(Properties.Resources.Hour); cBUpdateTime.Items.Add(Properties.Resources.Hour);
cBUpdateTime.Items.Add(Properties.Resources.Day); cBUpdateTime.Items.Add(Properties.Resources.Day);
cBUpdateTime.SelectedIndex = index; cBUpdateTime.SelectedIndex = index;
cBUpdateTime.EndUpdate();
} }
else if (cBUpdateTime.Items[0].ToString() == Properties.Resources.Hour) else if (cBUpdateTime.Items[0].ToString() == Properties.Resources.Hour)
{ {
int index = currentIndex; int index = currentIndex;
cBUpdateTime.BeginUpdate();
cBUpdateTime.Items.Clear(); cBUpdateTime.Items.Clear();
cBUpdateTime.Items.Add(Properties.Resources.Hours); cBUpdateTime.Items.Add(Properties.Resources.Hours);
cBUpdateTime.Items.Add(Properties.Resources.Days); cBUpdateTime.Items.Add(Properties.Resources.Days);
cBUpdateTime.SelectedIndex = index; cBUpdateTime.SelectedIndex = index;
cBUpdateTime.EndUpdate();
} }
} }