CREATING MODULES
THE PROGRAM LOOKS LIKE THIS:
MODULE MODULE1
DIM form1As New Form1
DIM form2As New Form2
Sub Main()
MsgBox("This is module")
form1.Show()' trying to call form1
form2.Show()
End Sub
End Module
Public Class Form1
Private SubButton1_click(.........) Handles
Button1.Click
Label1.text ="Hello World"'print if
program gets here'
End Sub
Private SubForm1_Load(By value .........)
Handles Mybase.Load
MsgBox("This is Form1")
End Sub
End Class
Public Class Form2
Private SubButton1_click(.........) Handles
Button1.Click
Label1.text ="Hello World"'print if
program gets here'
End Sub
Private SubForm2_Load(By value .........)
Handles Mybase.Load
MsgBox("This is Form2")
End Sub
End Class
The program works like this:
The message"This is module"was used to let me know that the program started in the module.
When the form1.Show() command is executed inSub Main of the module ; control transfers to form1. The message"This is Form1"lets me know than the form1_Load procedure worked.
The problem at this point is that the program returns back to the module.I want the program to stay in form1 until I click themouse button on Button1_Click.
Now it gets wierd to me.
When form2.show() is executed; control is passed to form2 and the messagebox"This is form2" is executed in the form2_load handler.
At this point the odd thing is that the form1 visual window appears on the screen along with the messagebox control. Pressing ok in messagebox returns control to the module.Again I want the program to stay in form2.

