Assume that I have a WinFoms project. There is just one button (e.g. button1
).
The question is: is it possible to trigger the ButtonClicked
event via code without really clicking it?
Button controls have a PerformClick() method that you can call.
button1.PerformClick();