### Handle Form Close via System Close

To handle form closing via system close, use MainForm CloseRequest event.
Example
' Handle form closing via system close (top right X button)
`Sub MainForm_CloseRequest (EventData As Event)
updateConfig
End Sub`
`Sub updateConfig
' Do something
End Sub`
Another option is use following below. The advantadge is that AppExit ensures proper app closure,
with any related actions required.
`Sub AppExit
updateConfig
MainForm.Close
End Sub`
`Sub MainForm_CloseRequest (EventData As Event)
EventData.Consume
AppExit
End Sub`
`Sub buttonOK_Action
AppExit
End Sub`
`Sub updateConfig
' Do something
End Sub`

Changed: 2018-04-21 14:11, Category: Forms, File: T6C195M1419.htm, ID: 1419