Mykel Stone

Mykel Stone

  • NA
  • 13
  • 0

(Solved)C# problem, running methods multiple times for no reason

Mar 5 2008 12:38 PM
I'm having a very freaking weird issue with C#, that doesn't seem to be making sense to me, sorry for the length of this, but I feel I have to be detailed. I have a class called Core, in this class, I create instances of all the forms that my program uses. Theres a welcome form, a next button is clicked, which brings up another form that checks asks if the user is a child, sending them to a form for either adults or children, this form checks the fields, and if the required information is entered, consolidates that information and creates 3 pages, presents a preview of each page on the last form, and the user clicks print to prints it if it looks alright, otherwise he can go back and edit.

What is happening is, things like the checking of the forms, button clicks, and the printing, it will begin to repeat these actions more than once. Every time the form is brought up, this behavior will increment, so if I start on the adult form, enter the information a click next, it'll go to the print form, it'll print once, but if i go to edit, the adult form will do everything twice, after i go back to the print form, the same behavior will occur on that one as well.

All controls are created at run time, and each form is hidden, its never destroyed, when I switch between forms, all I do is show the next form, and hide the previous one. And its happening with every method in each form. I've never had this happen before, what could be causing it??

Answers (1)