Solved

How do I send from text box to text box?

Posted on 2004-04-27
6
257 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now