The fact that it's a UserControl is irrelevant. It's just a class. You add events to any class the exact same way:
CSharp Code:
public event EventHandler MyEvent;
protected virtual void OnMyEvent(EventArgs e)
{
if (this.MyEvent != null)
{
this.MyEvent(this, e);
}
}
To raise the event you call the OnMyEvent method:
CSharp Code:
this.OnMyEvent(EventArgs.Empty);
If you need to pass data to the event handlers then you'd use the generic EventHandler delegate:
CSharp Code:
public event EventHandler<CancelEventArgs> MyEvent;
protected virtual void OnMyEvent(CancelEventArgs e)
{
if (this.MyEvent != null)
{
this.MyEvent(this, e);
}
}
I've used CancelEventArgs there as an example but you can use any appropriate class that inherits EventArgs, either from the Framework or of your own creation. When you raise the event you obviously need to pass an object of that type to the OnMyEvent method.
One final note. I've also just used "MyEvent" as an example. You'd name your event something more appropriate and then name the method that raises it to match. If you look through the MSDN documentation you'll see that almost all events are raised by a method with the same name prefixed with "On".