As you can guess, I\'m kind of new to .NET and just want to reference a control on one form from another.
Usually I would just do Form.Control.Property but that does
I save the name of the person logging in to a textbox on the next form after they login like this. My login button has the last lines: Me.Hide() ( Not Me.Close() ) Admin.Show() End
When the user enters a correct username and password, it hides the login form and opens the next page, Admin.vb
In the Admin_Load of the Admin.vb page as the last lines I put:
Dim logged As String logged = Login.txtUser.Text Login.Close(). 'Close hidden login.vb' End Sub
So, the user presses the login button and it hides the login form with the value I want in the txtUser textbox. Then it opens the Admin page. The load event of the Admin page, gets my value from the hidden login page in the txtUser textbox and puts it in the parameter "logged." Once the value is grabbed, it closes the login page and leaves the sub. It all happens in the blink of an eye! Now anywhere I want to use the name of the person that logged in, like in a textbox I just use "logged."
txtchangesby.Text = logged
Very simple and works.