I want to test some forms. Is there a way to simulate the press of an Ok (or Cancel) button so that the button is pressed and fires the event handlers that are associated wi
It's better to use the PerformClick() method of the Button =>
PerformClick()
button1.PerfomClick()
If your Button is not in the right state to click (enabled false or not visible), it will not perform the click eventmethod.