You will need to create a Sub Main() Method within a module and set
the Main() method as the startup object, this can be done in the
project properties dialog
the module containing the Sub Main() method will then need to contain
something similar to the following
Module modMain
Public Sub Main()
Dim objLoginForm as New LoginForm
'Use showdialog() instead of show() to stop the
'application from displaying the main form until the
login form has been closed
objLoginForm.ShowDialog
'Create the main form
Dim myAppfrm as new YourMainForm
'Use Application.Run instead of myAppfrm.show as this
will then treat the myAppfrm as the main message loop and not exit the
application until it has closed
Application.Run(myAppfrm)
End Sub
End Module
I hope this helps.
Regards
James Thresher
On Wed, 15 Jun 2005 03:14:03 -0700, "Steve"
<St***@discussions.microsoft.com> wrote:
I am new to .Net and Visual Studio, I have a login form and my main
application form. When I login I want to call the application form, and
dispose of the login. I have tried doing something like:
This.Hide
myAppfrm.Show();
but then when I close down the myAppfrm, the system hangs as the login
screen is still floating about in memory. How is this delt with normally in
the .Net fraternity?
Thanks