Skip to content

Method's question...

ablivian

Asked Apr 11, 2006, 3:04 PM EDT2 answers
Share
LinkedInX
I'm trying to create a simple application that requires the user to enter their username and password before the application will execute.

The password front end words great, but when I run the program it runs both the password method and the application method at the same time.

Is there anyway of stopping the application from executing before the previous method has run?

The following code is what I am using:

public static void Main()
{
    //Request name and password from user
    PasswordDialog objCallMethod = new PasswordDialog();
    objCallMethod.Show();

    //If Username and password are confirmed run the application
    Application.Run(new fclsMain());
}

I've probably got it all completely wrong but then I'm completely new to this....

Any ideas would be a help!

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    +1
    Why not make the password dialog modal?

    if (objCallMethod.ShowDialog() == DialogResult.OK)
      {
           Application.Run(...
      }
      else
       {
         
       }
    +1
  • Mike Gold
    +1
    sorry, something wrong with the editor and this posted like 50 times <g>

    -Mike
    +1