
September 16th, 2003, 02:09 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Location: Bavaria, Germany
Posts: 140
Time spent in forums: 3 h 40 m 41 sec
Reputation Power: 11
|
|
Assuming you're coding a Windows Application (not a ASP.Net Web UserControl)...
Just define a public event and a custom delegate (if you want to)...that's it :-)
Code:
public class UserControl1 : System.Windows.Forms.UserControl {
// ...
public event EventHandler OnClick;
// ...
public void SomeFuncWhichFiresClickEvent() {
// ...
// fire event
if (OnClick != null)
OnClick(this, new EventArgs());
}
// ...
}
|