Good day. Can you please tell me how to remap the button for closing the program (a cross in the corner)? I want to hang on her another action.
Thanks in advance!
https://msdn.microsoft.com/ru-ru/library/system.windows.forms.form.formclosing(v=vs.110).aspx
FormClosingThe event occurs when the form is closed. If the form closes, it is deleted, freeing all the resources associated with the form. When you cancel this event, the form remains open. To cancel the closing of the form, set theCancelPropertiesFormClosingEventArgsis passed to the event handler fortrue.If the form is displayed as a modal dialog box, clicking the Close button (the button with an
Xsign in the upper right corner of the form) causes the form to be hidden andDialogResultSet theDialogResult.Cancelproperties. You can override the value assigned to theDialogResultProperties when the user clicks the Close button, setting theDialogResultproperty in the event handler for theFormClosingform event.
Form.Closing method - qwabraSource: https://ru.stackoverflow.com/questions/792746/
All Articles