Raising Events Between User Controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 user controls on a form.
One control has a textbox and a button.
The other has a textbox.
When the user clicks the button on the first control I want the text to
appear in the other controls text box.

Can anyone point me in the right direction here ?
I know that I must raise an event on the parent for but am a bit lost.

Thankyou in advance
 
I have 2 user controls on a form.
One control has a textbox and a button.
The other has a textbox.
When the user clicks the button on the first control I want the text to
appear in the other controls text box.

Can anyone point me in the right direction here ?
I know that I must raise an event on the parent for but am a bit lost.

It's better not to store data in control, but to bind them both to the same
variable.
In your simple case, you should just add event to button (double click on
"Click" event in the Properties), and do your business logic in this code.
There are a tons of variants. Choose your best. Go through the way "Basic
OOP book => MVC => how to make GUI right" ;)
 
Back
Top