Hello I am new to the book and this forum I am having a difficulty with this project and hoping that someone can help me.
I fully looked at the program I made from the book and compared it to the project file here in the website and I cannot seem to see any difference other than mine is not working.
Whenever I run my program it says
"ArgumentOutOfRangeException was unhandled" InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.Parameter name: SelectedIndex
on the code below
private void RedrawForm()
{
exits.Items.Clear();
for (int i = 0; i > currentLocation.Exits.Length; i++)
exits.Items.Add(currentLocation.Exits[i].Name);
exits.SelectedIndex = 0;
I looked at the working file from the website and I see no difference to what I have done but I just cant' seem to make my project work. Do I have to change any properties to the combobox or event handlers? Any feedback on this would be great. Thank You












