G
Guest
Hi I am trying to raise a user control event but in the test the event is
always null so never fires. Why is this please?
public event EventHandler Click;
private void butOK_Click(object sender, System.EventArgs e)
{
// Call event method.
OnClick(EventArgs.Empty);
}
protected virtual void OnClick(EventArgs e)
{
if (Click != null)
// Raise the event.
Click(this, e);
}
always null so never fires. Why is this please?
public event EventHandler Click;
private void butOK_Click(object sender, System.EventArgs e)
{
// Call event method.
OnClick(EventArgs.Empty);
}
protected virtual void OnClick(EventArgs e)
{
if (Click != null)
// Raise the event.
Click(this, e);
}