
I feel stupid -problems showing a second form (Vb.Net)
I would like to do the same thing as I would have done with the following
Vb6 code :
form2.show
form2.zorder (0)
I want to create a form1 with a button1.
Button1_click is supposed to start up form2.
In a module (former .bas file) I have the following statement
Public WithEvents Skjermbilde2 As New Form2()
In Form1 Button1_click i have the following code :
Skjermbilde2.Show()
This works fine the first time I click on button1 but after closing form2
and clicking once more I get the following error :
An unhandled exception of type 'System.ObjectDisposedException' occurred in
system.windows.forms.dll
Additional information: Cannot access a disposed object named "Form2".
Can anyone help me ?
Jeroen Schi?tt