7 Replies - 944 Views - Last Post: 29 June 2013 - 02:00 AM Rate Topic: -----

#1 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Copy textbox value to another textbox?

Posted 29 June 2013 - 12:56 AM

Is there any code to transfer the value of a textbox to another textbox?

Im using a code that transfer the value of a textbox but the value of the 2 textbox is getting empty

the code is:

        IDTextBox.Text = IDTextBox9.Text



Is This A Good Question/Topic? 0
  • +

Replies To: Copy textbox value to another textbox?

#2 vks.gautam1  Icon User is offline

  • D.I.C Regular

Reputation: 17
  • View blog
  • Posts: 317
  • Joined: 21-March 08

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:00 AM

wt event you are using now? there is noting wrong in your code.
Is this on button click?

This post has been edited by vks.gautam1: 29 June 2013 - 01:05 AM

Was This Post Helpful? 0
  • +
  • -

#3 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:16 AM

Yes sir its in a button click event..
Was This Post Helpful? 0
  • +
  • -

#4 vks.gautam1  Icon User is offline

  • D.I.C Regular

Reputation: 17
  • View blog
  • Posts: 317
  • Joined: 21-March 08

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:18 AM

show here to whole code.
try this also.
msgbox(IDTextBox9.Text)


Both textbox are on same form.
use try and catch exception

This post has been edited by vks.gautam1: 29 June 2013 - 01:20 AM

Was This Post Helpful? 0
  • +
  • -

#5 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:24 AM

my first textbox is in the tab_page1 then the second textbox is in the tab_page2..

Private Sub btn_add_to_enrollment_list_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_add_to_enrollment_list.Click
IDTextBox.Text = IDTextBox9.Text
FnameTextBox.Text = FnameTextBox1.Text
LnameTextBox.Text = LnameTextBox1.Text
YrlevelTextBox.Text = YrlevelComboBox1.Text
StatusTextBox.Text = StatusTextBox1.Text


End Sub

I used try catch but theres no error displayed
Was This Post Helpful? 0
  • +
  • -

#6 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:31 AM

I search for other codes and it works, thanks :)
here is the code:
  IDTextBox9.Text = "" & IDTextBox.Text & ""


Was This Post Helpful? 0
  • +
  • -

#7 vks.gautam1  Icon User is offline

  • D.I.C Regular

Reputation: 17
  • View blog
  • Posts: 317
  • Joined: 21-March 08

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 01:36 AM

View Postvbnewbeginer, on 29 June 2013 - 01:31 AM, said:

I search for other codes and it works, thanks :)/>/>
here is the code:
  IDTextBox9.Text = "" & IDTextBox.Text & ""


Have u found any explnation why is this working ? is there any sepecific things to do with control in tab.im also new in vb.net .
hmmmm u was sending wrong value ok
this was your code earlier.
IDTextBox.Text = IDTextBox9.Text



destination=source
this is your new code

IDTextBox9.Text = "" & IDTextBox.Text & ""


This post has been edited by vks.gautam1: 29 June 2013 - 01:42 AM

Was This Post Helpful? 1
  • +
  • -

#8 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Re: Copy textbox value to another textbox?

Posted 29 June 2013 - 02:00 AM

yes this will copy the value of IDTextBox.text to IDTextBox9.Text
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1