In the properties of project I created a setting like this
NumberOfUsers int User 10
The columns are Name, Type, Scope and Value.
Then there is a ComboBox where user can set a 'NumberOfUsers'. This combo has SelectedIndexChanged event where I save the changes whenever the user change the value of combo. Here's the code:
Settings.Default.NumberOfUsers = combo1.SelectedIndex;
Settings.Default.Save();
The form with this combo is called from the parent as frm.ShowDialog();
and in Constructor of the child form I try to set combo's selected index based on the Settings entry
combo1.SelectedIndex = Settings.Default.NumberOfUsers;
However, this DOES NOT work, that is the combo does not pull the value from setting, but it rather defaults to 0 as selected index.
Anyone knows where I make mistake?