How do I pass text between forms?

Disasterpiece

Freshman
Joined
Apr 2, 2003
Messages
47
Location
Blacksburg, VA
I have a login form with username and PW textboxes and I want to pass the username into a variable on another form.

However when I try to test to make sure it's working it outputs nothing in my test label.

I have my Username Textbox set to public so I don't know why this isn't working...

Here is my code, what's wrong!!?

Visual Basic:
Public frmLoginInstance As New frmLogin()

    Public strUsername As String = CStr(frmLoginInstance.txtUserName.Text)

Thanks
 
You can create a Public Property to Set/Get the username. Place this Property either in a new class or in your main form.
 
So if I did a class with just a property for the Username, and then instantiated an object as that class type, and then set the username property of the object to CStr(frmLoginInstance.txtUsername.Text) it would work?

Seems like that isn't really doing anything different but then again I'm lost and clueless when it comes to programming so maybe you meant something else?
 
Back
Top