Override the "X" button

AlexCode said:
Visual Basic:
        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    MessageBox.Show("Should reach here!")
                    components.Dispose()
                    MessageBox.Show("This will not show!!")
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

Tried...but no messagebox shown. Seems the dispose method is never called.


mskeel said:
Do you have any new theories since you can see and walk through the code?

No...I am already exhausted. :p

Thanks for ALL your input and ideas.
 
Couple ?'s:
Can you duplicate this behavior when running your exe on different machines?
Can you duplicate this behavior when building in Debug and Release configurations?
How is the problematic form being launched? (e.g. from another form, at application startup, from a call across assemblies)
Do other basic form functionalities work? (minimize, maximize)
What is the property WindowState set to?
Are you positive that there is not any ActiveX controls running any where in the vicinity of the problematic form?
What version of .NET Framework are you using?
 
Can you duplicate this behavior when running your exe on different machines?
Yes, all my colleagues experience the same problem.


Can you duplicate this behavior when building in Debug and Release configurations?
Yes.


How is the problematic form being launched? (e.g. from another form, at application startup, from a call across assemblies)
At application startup - System.Windows.Forms.Application.Run(new MyForm());


Do other basic form functionalities work? (minimize, maximize)
Yes.


Are you positive that there is not any ActiveX controls running any where in the vicinity of the problematic form?
Yes, sure. NO ActiveX stuff, all are managed code.


What version of .NET Framework are you using?
VS.NET 2002 + .NET Framework 1.03705
 
Back
Top