Call a Click event

  • Thread starter Thread starter John S
  • Start date Start date
J

John S

Is it possible to call the click event of a control from another method or
class?
 
Override OnClick event and Call it from public function
protected override void OnClick(EventArgs e)

{

base.OnClick (e);

}

public void ClickMe()

{

OnClick(null);

}
 
no. that's the difference between 'event' and 'delegate' - 'event's can
only be fired by the object that holds them
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top