djdx2
asked on
How do I send from text box to text box?
I have a text box named txtFname.text and txtLname.txt in two different forms. I want to send the first txtFname.text which is in my FindCustomer.vb form to the txtFname.text on another form which is called SelectService.vb, how can I do this? I need to do the same for txtLname.text field.
Declare txtFname on SelectService form as public, then you will be able to call SelectService.txtFName.Tex t = txtFname.Text from FindCustomer form
OR
in SelectService form create a property:
Public Property FName As String
Set(ByVal Value As String)
txtFName.Text = Value
End Set
End Property
and assign text using that property
OR
in SelectService form create a property:
Public Property FName As String
Set(ByVal Value As String)
txtFName.Text = Value
End Set
End Property
and assign text using that property
ASKER
I actually want to send it from a text box named txtFName1 to a label now named lblFName when the button is clicked....how about this?
Also, you will need a reference to the SelectService form somewhere.
In a module store a global variable like this:
Module Stuff
Public _SelectService as Form
End Module
When you instantiate the form, set the reference variable to point to the form like this:
Dim f as New SelectService()
f.Show
_SelectService = f
Now you can talk to all of the public items on the form just like chaniewskim was saying:
_SelectService.FName = "Test"
or
_SelectService.txtFName.Te xt
In a module store a global variable like this:
Module Stuff
Public _SelectService as Form
End Module
When you instantiate the form, set the reference variable to point to the form like this:
Dim f as New SelectService()
f.Show
_SelectService = f
Now you can talk to all of the public items on the form just like chaniewskim was saying:
_SelectService.FName = "Test"
or
_SelectService.txtFName.Te
The text field of the label can be altered the same way as the textbox.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER