From Inherits

B

Brian

Hi,
playing around i created a form that has a calendar and a textbox1.
I created another from that inherits from form1. on this second form I put
another textbox(textbox2). Now, on the second from when the value in the
form1.textbox1 changes, I want it to be displayed in textbox2 also. How is
this done?
Brian
 
K

kimiraikkonen

Hi,
playing around i created a form that has a calendar and a textbox1.
I created another from that inherits from form1.  on this second form I put
another textbox(textbox2).  Now, on the second from when the value in the
form1.textbox1 changes, I want it to be displayed in textbox2 also.  Howis
this done?
    Brian

On your second form,
textbox2.text = form1.textbox1.text should do the trick in any control
event you desire, however you may want to put this in textbox2's
textchanged event to equalise in every type attempt on textbox2.

Hope this helps,

Onur
 
B

Brian

I did that on the form load.... what I need I suppose is access to the event
handler for textbox1?

Me.TextBox2.Text = frmMain.TextBox1.Text

Hi,
playing around i created a form that has a calendar and a textbox1.
I created another from that inherits from form1. on this second form I put
another textbox(textbox2). Now, on the second from when the value in the
form1.textbox1 changes, I want it to be displayed in textbox2 also. How is
this done?
Brian

On your second form,
textbox2.text = form1.textbox1.text should do the trick in any control
event you desire, however you may want to put this in textbox2's
textchanged event to equalise in every type attempt on textbox2.

Hope this helps,

Onur
 
K

kimiraikkonen

I did that on the form load.... what I need I suppose is access to the event
handler for textbox1?

Me.TextBox2.Text = frmMain.TextBox1.Text




On your second form,
textbox2.text = form1.textbox1.text should do the trick in any control
event you desire, however you may want to put this in textbox2's
textchanged event to equalise in every type attempt on textbox2.

Hope this helps,

Onur

You can add event handler to call event, however you can equalise
textboxes in form_load as you've done. When do you want to equalise
two textboxes?
 
B

Brian

i was just wanting to test.. on form1 with the monthcalendar, I have the
date being put into textbox1... but I'd to see when the value on textbox1
changes it changes in textbox2 on form2.
Brian
I did that on the form load.... what I need I suppose is access to the
event
handler for textbox1?

Me.TextBox2.Text = frmMain.TextBox1.Text




On your second form,
textbox2.text = form1.textbox1.text should do the trick in any control
event you desire, however you may want to put this in textbox2's
textchanged event to equalise in every type attempt on textbox2.

Hope this helps,

Onur

You can add event handler to call event, however you can equalise
textboxes in form_load as you've done. When do you want to equalise
two textboxes?
 
B

Brian

ok, what event would i call in with the inherit form1.monthcalendar has been
changed and I want that date to show up on form2.textbox2?
 
B

Brian

oK... Create a even for textbox1 in form2.. and instead of
frmmain.textbox1.text I used textbox1.text......
I got to thinking that it must copy the controls over as well.. that is why
the default frist textbox I added was textbox2.
Thanks for the help
Brian
I did that on the form load.... what I need I suppose is access to the
event
handler for textbox1?

Me.TextBox2.Text = frmMain.TextBox1.Text




On your second form,
textbox2.text = form1.textbox1.text should do the trick in any control
event you desire, however you may want to put this in textbox2's
textchanged event to equalise in every type attempt on textbox2.

Hope this helps,

Onur

You can add event handler to call event, however you can equalise
textboxes in form_load as you've done. When do you want to equalise
two textboxes?
 
B

Brian S.

Ok, thought I had this but I don't... when i look at the form2(child) I get
errors about not being displayed.....
This should be simple, but I am not seeing it....
when I click on calendar1 from form1 and the textbox1 changes...... I want
to know how I can
set the text in textbox2 on the form2 and how do I read the value of
textbox1 or the calender value from form2...
Please help :)
Brian
 
B

Brian S.

ok.. think i have this.. so far so good.. hopfully.. i went into Form1's
Private Sub InitializeComponent() and found the delareration for textbox1
which was

Friend WithEvents TextBox1 As System.Windows.Forms.TextBox and change it
to

Protected WithEvents TextBox1 As System.Windows.Forms.TextBox
 
B

Brian S.

lol... i didn't relize... it under the properties... called modifiers...
:(.. hey.. got to start somewhere..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top