I have a simple Windows Forms based application which I am trying to upgrade from Visual Basic 6.0 to Visual Basic .NET. At the moment, all I am trying to do is open a form from a module. That is, I have a form called frmProgress and a module called modBas. In modBas is the following code:
[tt]Module modBas
Public Sub Main()
Dim myform As New frmProgress
myform.Show()
End Sub
End Class[/tt]
This does indeed show an instance of the frmProgress form but it then closes it again and stops the project!? In Visual Basic 6.0, it would leave the form open (thus the project would still be running, even though it wasn't doing anything).
Is this behaviour by design? Is there any way I can force the form to stay open? I don't want to use the .ShowDialog function because then the code doesn't move onto the next line.
Dan Griffiths
Software Analyst
National Grid plc
[tt]Module modBas
Public Sub Main()
Dim myform As New frmProgress
myform.Show()
End Sub
End Class[/tt]
This does indeed show an instance of the frmProgress form but it then closes it again and stops the project!? In Visual Basic 6.0, it would leave the form open (thus the project would still be running, even though it wasn't doing anything).
Is this behaviour by design? Is there any way I can force the form to stay open? I don't want to use the .ShowDialog function because then the code doesn't move onto the next line.
Dan Griffiths
Software Analyst
National Grid plc