We help IT Professionals succeed at work.

Moving text between textboxes

jlavetan
jlavetan used Ask the Experts™
on
I have a form with two textboxes and two buttons and want to do the following:

When btnPush1 is selected, the contents of txtBox1 are copied to txtBox2, and when btnPush2 is pressed, the contents of txtBox2 are copied to txtBox1.

I know it has something to do the textbox properties, but I'm extremely new at this and can't figure it out...

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
do these work for you?


private sub btnPush1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPush1.Click
      txtbox2.text = textbox1.text
end sub

private sub btnPush2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPush2.Click
      txtbox1.text = textbox2.text
end sub


NY

Author

Commented:
Yep, that was it...  I could of sworn I had that... I guess I had some syntax wrong...

Thanks!
glad it worked out! thanks for the grade

NY