How do I completely unload a form?

Hi all,

I have a form that I use to get the user to input such as a username and password in order to make a network connection. This connection can be disconnected and reconnected as many times as neccessary whilst the application continues to run.

I obviously, therefore, need the form's text boxes, combo boxes etc to reset to their blank versions every time that the form is shown.

In VB6 this was easy; you just unload the form which completely removed the form from memory and thus the next time you showed it it was reset to it's blank state. In VB 2005, however, there is no unload so we have to use Close. I have done this and assumed that it would function in the same was that unload did in VB6.

The problem is that when I close the form using the form.close event handler the form disappears perfectly but when the form.show/showdialog is used the old form data still remains telling me that the form hasn't actually been unloaded but rather appears to have just been hidden.

Can anyone please shed any light on this?

Ady

[1081 byte] By [AdrianFoot] at [2007-12-24]
# 1

Got it :-)

Form.Dispose

Easy lol just well hidden in all of my books!

Ady

AdrianFoot at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...