S
Steve McLellan
Hi all,
I'm trying to override Form events (for example OnClosing or OnClose) with
the intention of preventing the base class function from happening. My
functions are getting called but so are the base class ones, which isn't
what I want (for example, I was hoping an empty OnClose event would make
closing the form impossible). Two questions: 1) Is this the right way to do
this, or should I be detaching event handlers? and 2) Any reason why I'm
getting this behaviour?
Some brief code:
public __gc class WmSizeFixerApplicationForm : public
System::Windows::Forms::Form
{
// .... gubbins to initialise everything omitted
protected: void OnClosing( System::ComponentModel::CancelEventArgs *e )
{
// do nothing
}
protected: void OnClosed()
{
// do nothing
}
};
Thanks!
Steve
I'm trying to override Form events (for example OnClosing or OnClose) with
the intention of preventing the base class function from happening. My
functions are getting called but so are the base class ones, which isn't
what I want (for example, I was hoping an empty OnClose event would make
closing the form impossible). Two questions: 1) Is this the right way to do
this, or should I be detaching event handlers? and 2) Any reason why I'm
getting this behaviour?
Some brief code:
public __gc class WmSizeFixerApplicationForm : public
System::Windows::Forms::Form
{
// .... gubbins to initialise everything omitted
protected: void OnClosing( System::ComponentModel::CancelEventArgs *e )
{
// do nothing
}
protected: void OnClosed()
{
// do nothing
}
};
Thanks!
Steve