Solved

How do I send from text box to text box?

Posted on 2004-04-27
6
259 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:djdx2
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Author Comment

by:djdx2
ID: 10931562
By the way I want this to happen when I click on a button named... btnGoToService
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10931639
Declare txtFname on SelectService form as public, then you will be able to call SelectService.txtFName.Text = 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
0
 
LVL 1

Author Comment

by:djdx2
ID: 10931855
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?
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 2

Expert Comment

by:Jeffr0
ID: 10931886
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.Text
0
 
LVL 2

Expert Comment

by:Jeffr0
ID: 10931899
The text field of the label can be altered the same way as the textbox.
0
 
LVL 5

Accepted Solution

by:
chaniewskim earned 125 total points
ID: 10931903
OK, so don't worry with creating properties - you'll have time to learn this.

Click lblFName and set Modifier to Protected (using Properties window)

Then doubleclick btnGoToService and place a code

SelectService.lblFName.Text = txtFName1.Text

I don't know the name of you SelectService form variable - so update that code accordingly.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question