Hello,
It'll be same as you consume events for other controls inside the form.
Suppose you have defined a delegate named MyDelegate in the usercontrol
and an event MyTextEvent. Inside the button click event handler or
usercontrol, you'll raise the custom event for setting the text in the
textbox, and consume it in the form. Please see the following code
snippet for the scenario i have just described. Suppose UserControl's
name is MyUserControl
//Inside UserControl
public delegate void MyDelegate(string textToSet);
public event MyDelegate MyTextEvent;
....
//Inside Button Click's event handler
if(MyTextEvent != null) //Checks if anyone has registered the event.
MyTextEvent("This is a sample text");
//Inside the form that contains TextBox (textBox1) and the UserControl
(myUC1)
//Inside Form's Load event.
myUC1.MyTextEvent += new MyUserControl.MyDelegate(myUC1_TextEvent);
//Event Handler for the UserControl's custom event.
protected void myUC1_TextEvent(string textToSet);
{
textBox1.Text = textToSet;
}
----------------------------------------
I hope it'll make things clear for you now

Bye! Cheers.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!