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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C# Problem

  • 07-09-2008 7:27pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 303 ✭✭brian_rbk


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


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


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


  • Registered Users, Registered Users 2 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