By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,640 Members | 2,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,640 IT Pros & Developers. It's quick & easy.

Login form closing on loading usercp

P: 9
I'm developing a program with a login form. I want the login in form to be the first form that loads, and I want it to close itself when the main CP loads. However, when I set frmLogIn as the startup form and attempt to close it upon loading the next form it closes the entire program.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
  2.  
  3.         frmMain.Show()
  4. End Sub
That is the code to load the main CP.

Expand|Select|Wrap|Line Numbers
  1.  
  2.     Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3.         frmLogin.Close()
  4.  
  5.  End Sub
  6.  
That is the code I'm attempting to use to close the login form when the form with the CP on it loads.

Any help is appreciated.


EDIT I managed to find an answer.

Expand|Select|Wrap|Line Numbers
  1.     Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
  2.         frmMain.Show()
  3.         Me.Hide()
  4.  
  5.  
  6.     End Sub
  7.  
Me.Hide() makes the login form 'invisible'. So that it doesn't show after the CP loads.
Sep 5 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.