How to get a pass code from form2 to form1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chris52672
    New Member
    • Mar 2009
    • 26

    How to get a pass code from form2 to form1

    I am launching (form2.show()) from form1

    In form2 the user has to enter a pass word. I need to pass this password off to form1 how do I do that?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    I'm guessing its "password week" at some school because all of a sudden this week's theme on questions is how to pass passwords from one form to another.

    Check the post 3 before yours

    [IMGNOTHUMB]http://files.me.com/tlhintoq/4uocjd[/IMGNOTHUMB]

    Comment

    • chris52672
      New Member
      • Mar 2009
      • 26

      #3
      I still am confused is there something that is dumbed down a little more for the complete novice?

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        I try to think of things in the order that I will use them Form1, Form2, Form3... then build them in reverse order.. Form3, Form2, Form1 for one very practical reason: I can't reference Form2 inside of Form1 if I haven't yet *built* Form2.

        So build your Password form.
        Put a UserName textbox on it
        Put a Password textbox on it.

        In your main form:
        Code:
        PasswordForm myPasswordForm = new PasswordForm();
        myPasswordForm.ShowDialog();
        string PassedInUsername = UserNameTextbox.text;
        string PassedInPassword = PasswordTextbox.text;
        Can't get any simplier than that.

        Comment

        Working...