How do I go about overriding the default functionality when a user clicks the X in a VB.NET form-based application?
I am currently handling the MyBase.Closing event.
Re your other comments; doing anything before the event has fired would be premature; after all, some other code might cancel the close, and you'd be left with a scuppered form. Personally, I'd be tempted to override OnClosed; not much of a VB head, but in C#:
protected override void OnClosing(CancelEventArgs e)
{
// check OK to close (save/cancel etc)
base.OnClosing(e);
}
protected override void OnClosed(EventArgs e)
{
// your code here
base.OnClosed(e);
// or here
}