By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Text Box In Visual Basic

P: 1
I would to get codes which copy a content in text box into another one using visual basic 6.0
Sep 22 '07 #1
Share this Question
Share on Google+
4 Replies


10K+
P: 13,264
I would to get codes which copy a content in text box into another one using visual basic 6.0
Moved to Visual basic forum.
Are the texboxes on the same form? Can you post the codes that you have so far?
Sep 22 '07 #2

FullyH3ktik
P: 52
If you want the text in the first text box to be displayed in the second text box as you write it, you do this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  2.     TextBox2.Text = TextBox1.Text
  3. End Sub
Providing that the first text box is called TextBox1 and the second text box is called TextBox2


If you want the text in the first text box to be displayed in the second text box when you press a button, use this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.     TextBox2.Text = TextBox1.Text
  3. End Sub
Also Providing that the button is called Button1
Sep 22 '07 #3

P: 23
in vb6:

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'without button
  3. Private Sub Text1_Change()
  4. Text2.Text = Text1.Text
  5. End Sub
  6. '
  7. 'with button
  8. Private Sub Button1_Click()
  9. Text2.Text = Text1.Text
  10. End Sub
  11.  
  12.  
Sep 23 '07 #4

jamesd0142
100+
P: 469
textbox1.text = textbox2.text

this copies the value in textbox2 into textbox1.
Sep 25 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.