• 0

[VB.NET] Form Confusion


Question

I'm making a program that has 3 forms. The first one is used to set settings, the 2nd is the main part (a quiz), and the 3rd is a summary of the questions/answers.

I want to include a reset function that takes the user back to the original form and starts again. A lot of my variables are stored in a module, and if I use .close on any of the forms they dispose of the variables used in that particular form. However if I hide them, then the _load event never happens after the first time.

How can I get past this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
I'm making a program that has 3 forms. The first one is used to set settings, the 2nd is the main part (a quiz), and the 3rd is a summary of the questions/answers.

I want to include a reset function that takes the user back to the original form and starts again. A lot of my variables are stored in a module, and if I use .close on any of the forms they dispose of the variables used in that particular form. However if I hide them, then the _load event never happens after the first time.

How can I get past this?

Have you tried Application.Restart() ?

Link to comment
Share on other sites

  • 0

When you hide the form, you are not closing it, thus when it is shown again, nothing is being loaded, just made visible, hence why the load event doesn't fire.

I would move your variables to another part of your program, say a Shared variable in your Program.vb file?

Link to comment
Share on other sites

  • 0

I did something similar for a client. The main page has a grid which needs to be updated every 30 secs. Whenever I referred back to show the form, I just let the timer I inserted take care of it.

My only problem (yet to be resolved) is to hold the grid scrollbars in place, else it ends up on row zero upon each refresh.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.