I would to get codes which copy a content in text box into another one using visual basic 6.0
Text Box In Visual Basic
Collapse
X
-
Tags: None
-
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:
[CODE=vbnet]Private Sub TextBox1_TextCh anged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles TextBox1.TextCh anged
TextBox2.Text = TextBox1.Text
End Sub[/CODE]
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:
[CODE=vbnet]Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
TextBox2.Text = TextBox1.Text
End Sub[/CODE]
Also Providing that the button is called Button1Comment
-
in vb6:
Code:'without button Private Sub Text1_Change() Text2.Text = Text1.Text End Sub ' 'with button Private Sub Button1_Click() Text2.Text = Text1.Text End Sub
Comment
-
Comment