EDIT: commandz helped me understand why it was looping! Reason for error at the bottom

As some of you know, I'm learning C#. A few days ago my teacher wasn't feeling well so she let us do whatever we want "as long as it is C# related". So to kind of cheat that, I attempted to make a game hub that would launch whichever game I selected. Razz
I got as far as including Halo and Raven Field before I accidentally made a loop that continuously made errors pop up. I had to shut down the computer to get it to stop.



What my program did was have a drop down box (combo box) that would allow you to select a game to run. The option 'Halo' was on the top and 'Raven Field' was on the bottom. When I clicked on Raven Field however, it immediately started to quickly jump back and forth from Halo and Raven Field and made two different error windows pop up really quickly. You can see most of the code on the right side of the picture. I zoomed in on the part that had the wacky code.



I've narrowed down my problem to: I forgot the 'if' statement, a rookie mistake! But I'm a rookie at this so I'm fine with it. Laughing
What I'd like to know is: why did it start looping? I can see why it ran through once, but I don't understand why it kept going.
Also, why did it say that it couldn't find the file? I originally had a button that performed the same operation and it worked perfectly!
Lastly, what does that error in the bottom right corner of the left monitor mean?

EDIT: The reason why it was looping was because I was unintentionally changing what option was chosen when I did [greatGamesBox.Text="Halo";] and [greatGamesBox.Text="Raven Field";]. This caused the event handler to think "oh another option has been chosen! I need to execute my code again!". This is why it was looping.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement