Click here to Skip to main content
15,921,959 members
Home / Discussions / C#
   

C#

 
GeneralRe: .Net framework source code Pin
James T. Johnson23-Aug-02 4:37
James T. Johnson23-Aug-02 4:37 
GeneralRe: .Net framework source code Pin
Stephane Rodriguez.23-Aug-02 4:40
Stephane Rodriguez.23-Aug-02 4:40 
GeneralRe: .Net framework source code Pin
James T. Johnson23-Aug-02 4:42
James T. Johnson23-Aug-02 4:42 
GeneralRe: .Net framework source code Pin
leppie23-Aug-02 5:01
leppie23-Aug-02 5:01 
GeneralRe: .Net framework source code Pin
Stephane Rodriguez.23-Aug-02 5:49
Stephane Rodriguez.23-Aug-02 5:49 
GeneralRe: .Net framework source code Pin
Stephane Rodriguez.24-Aug-02 6:59
Stephane Rodriguez.24-Aug-02 6:59 
GeneralOwnerDraw TreeView Pin
Nnamdi Onyeyiri22-Aug-02 21:34
Nnamdi Onyeyiri22-Aug-02 21:34 
GeneralOverriding the 'X' button on a form Pin
Rodney S. Foley22-Aug-02 19:38
Rodney S. Foley22-Aug-02 19:38 
I have been trying to figure out, and search for how you can override the normal closing operation of a Form when a user hits the 'X' button, so that it just HIDES the form instead.

The closest I found in a forum someplace was they said to override OnClosing if you want to change how to handle the 'X' button default operations.

Like so:

protected override void OnClosing(CancelEventArgs e)
{
this.Hide();
}

However this does not work. The form is still disposed of, and when I try to show the form again I get an exception say just that.

Does anyone know how to do this, or can point me to an article or forum message someplace that explains this?

Thanks in advance...

Aalst
GeneralRe: Overriding the 'X' button on a form Pin
navinnx22-Aug-02 20:24
navinnx22-Aug-02 20:24 
GeneralRe: Overriding the 'X' button on a form Pin
Stephane Rodriguez.22-Aug-02 20:51
Stephane Rodriguez.22-Aug-02 20:51 
GeneralRe: Overriding the 'X' button on a form Pin
Rodney S. Foley22-Aug-02 21:00
Rodney S. Foley22-Aug-02 21:00 
QuestionDataGrid, to bind or not to bind? Pin
Luis Alonso Ramos22-Aug-02 16:49
Luis Alonso Ramos22-Aug-02 16:49 
AnswerRe: DataGrid, to bind or not to bind? Pin
Stephane Rodriguez.22-Aug-02 20:49
Stephane Rodriguez.22-Aug-02 20:49 
GeneralRe: DataGrid, to bind or not to bind? Pin
Luis Alonso Ramos23-Aug-02 4:21
Luis Alonso Ramos23-Aug-02 4:21 
Generalgetting location of schema used Pin
James McCutcheon22-Aug-02 13:08
James McCutcheon22-Aug-02 13:08 
Questioncom? Pin
imran_rafique22-Aug-02 10:36
imran_rafique22-Aug-02 10:36 
AnswerRe: com? Pin
David Stone22-Aug-02 10:46
sitebuilderDavid Stone22-Aug-02 10:46 
GeneralUsing MS WebBrowser AX Control under .NET Pin
tamas22-Aug-02 9:50
tamas22-Aug-02 9:50 
GeneralRe: Using MS WebBrowser AX Control under .NET Pin
Stephane Rodriguez.24-Aug-02 6:56
Stephane Rodriguez.24-Aug-02 6:56 
GeneralRe: Using MS WebBrowser AX Control under .NET Pin
Anonymous28-Aug-02 3:00
Anonymous28-Aug-02 3:00 
GeneralSerialization/Deserialization Using Sockets Pin
dwebster22-Aug-02 9:41
dwebster22-Aug-02 9:41 
GeneralRe: Serialization/Deserialization Using Sockets Pin
David Stone22-Aug-02 10:13
sitebuilderDavid Stone22-Aug-02 10:13 
GeneralRe: Serialization/Deserialization Using Sockets Pin
dwebster22-Aug-02 10:58
dwebster22-Aug-02 10:58 
GeneralRe: Serialization/Deserialization Using Sockets Pin
David Stone22-Aug-02 11:07
sitebuilderDavid Stone22-Aug-02 11:07 
GeneralRe: Serialization/Deserialization Using Sockets Pin
dwebster23-Aug-02 5:51
dwebster23-Aug-02 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.