The key is the problem of event parameter;
Since entering an event, then the two parameters of the event are the buttons that represent the response to the event, and you now
Specifies the event that invokes another button, then the argument for this event is not the button, but the first button.
Calling public code is a good solution.
Because the event in the button to pass object sender, EventArgs e These two parameters, as if not directly called,
The first workaround: It is recommended that you write the event handling code as a method (but make sure that you do not use sender and E in this method) so that it can be invoked in each button event.
The second workaround: The button event for the current form sets the form result and this. Dialogresult=system.windows.forms.dialogresult.ok or other results, accept the result in another form, make a judgment, and execute the appropriate code.