Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C# Problem

Options
  • 07-09-2008 8:27pm
    #1
    Registered Users Posts: 1,987 ✭✭✭


    I have the below code in a separate class, the thing is when it runs the frmMain show up but the frmLogin wont hide!?! Any ideas?
    frmLogin login = new frmLogin();
    frmMain main = new frmMain();
    
    login.Hide();
    main.Show();
    


Comments

  • Registered Users Posts: 303 ✭✭brian_rbk


    Try...
    frmLogin login = new frmLogin();
    frmMain main = new frmMain();
    
    login.Visible = false;
    main.Visible = true;
    


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    Nope, didn't work! Any other ideas, it seems very strange for it not to work!?


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    Got it working, i was creating and closing a new instance of the frmLogin form. I've added the function to return a boolean value to the login form so if the login details are all correct it'll return a true value so on the login form i have the below if statement and it seems to be working ok, thanks for that Plater.
    validate = dbconn.login(txtUsername.Text, txtPassword.Text);
    if (validate)
       this.Hide();
    


Advertisement