Passing text box info from one form to another.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • USBZ0r
    New Member
    • Mar 2009
    • 20

    Passing text box info from one form to another.

    hey guys

    i am trying pass login information from one form to another.

    basically, i have a login box with the names Username and Password on the login form, then that disposes and runs the next form by doing
    Code:
    Application.Run(new Window(parameters));

    how can i pass this information onto my "Window" form?
  • ddsuresh
    New Member
    • Jun 2010
    • 5

    #2
    You need to create properties on the form want to read the values. For example

    Code:
    public string Username
    {
        get; set;
    }

    You can pass the username to your form object.
    Code:
    myformObj.Username = "ddsuresh";
    Suresh

    Comment

    • ThatThatGuy
      Recognized Expert Contributor
      • Jul 2009
      • 453

      #3
      Originally posted by USBZ0r
      hey guys

      i am trying pass login information from one form to another.

      basically, i have a login box with the names Username and Password on the login form, then that disposes and runs the next form by doing
      Code:
      Application.Run(new Window(parameters));

      how can i pass this information onto my "Window" form?
      do as ddsuresh suggested, but make sure you assign the properties of the second form before you call ShowDialog() or before you show the form

      Comment

      Working...