Thx
Shared Sub Main()
Dim f As New Form1
f.Show()
Application.Run()
End Sub
Protected Overrides Sub OnClosed(ByVal e As System.EventArgs)
Dim f2 As Form2
MyBase.OnClosed(e)
f2 = New Form2
f2.show()
End Sub
Now you must call Application.ExitThread to exit Application.Run when the
application is to be terminated.
--
Armin
"Bob" <b...@bobber.com> schrieb:
\\\
Public Class Main
Public Sub Main()
Call (New Form1()).Show()
Application.Run() ' Create message loop.
End Sub
End Class
Public Class Form1
.
.
.
Call (New Form2()).Show()
Me.Close()
.
.
.
End Class
///
Use "Application.ExitThread" to quit the application (unload the forms
first).
Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
>.
>
Hi Armin,
Just curious: Why does this Sub HAVE to be named "Main"? It doesn't work
any other way. I'm assuming Main is some sort of a special class?
Thanks!
Each application must have an entry point. The standard is to call it Sub
Main. One might make it more flexible, but there's no reason.
--
Armin
I had it named LoadMain(), and for an hour I couldn't get it to work on
another project I am working on. I looked back at when I implemented it for
the splash screen, and changed it back to Main(), and it worked. It
definitely looks like something VB.NET requires for what I am trying to
accomplish. How would you add flexibility in the naming process, anyway?