R
Ryan
Hi All,
I could use a bit of help with Compact Framework and the Dispose method.
I have written an application which is made up as follows:
MyHintLabel is derived from UserControl
MyEditControl is derived from UserControl
MyEditControl is made up of a MyHintLabel and an edit control such as
TextEdit or Combo as defined in an XML document. This control also has
and resize event to position the label and edit control components.
EditTab which is a class which creates a tab page and adds the required
number of MyEditContols and handles the loading and saving of data from
them. Each EditTab item is saved to a List object and added to a tab
control on the main form.
Everything works OK until the application exits then I get Object
Disposed Exceptions occurring in the MyEditControl’s resize event.
Looking at the object the MyEditControl has been disposed BUT the
dispose function in MyEditControl.Designer.cs hasn’t been called for
example this.controls.count will cause an object disposed exception as
well as this.mylabel.bounds = new Rectangle (0, 0, labelWidth,
this.mylabel.height);
I can handle the exceptions and ignore them but this seems to slow down
the exiting of the application quite a bit. I’ve tried hanging off the
Disposed event to check when and item is gone but this doesn’t seem to
fire at all.
Any help and pointers would be greatly appricated.
Tanks
Ryan
I could use a bit of help with Compact Framework and the Dispose method.
I have written an application which is made up as follows:
MyHintLabel is derived from UserControl
MyEditControl is derived from UserControl
MyEditControl is made up of a MyHintLabel and an edit control such as
TextEdit or Combo as defined in an XML document. This control also has
and resize event to position the label and edit control components.
EditTab which is a class which creates a tab page and adds the required
number of MyEditContols and handles the loading and saving of data from
them. Each EditTab item is saved to a List object and added to a tab
control on the main form.
Everything works OK until the application exits then I get Object
Disposed Exceptions occurring in the MyEditControl’s resize event.
Looking at the object the MyEditControl has been disposed BUT the
dispose function in MyEditControl.Designer.cs hasn’t been called for
example this.controls.count will cause an object disposed exception as
well as this.mylabel.bounds = new Rectangle (0, 0, labelWidth,
this.mylabel.height);
I can handle the exceptions and ignore them but this seems to slow down
the exiting of the application quite a bit. I’ve tried hanging off the
Disposed event to check when and item is gone but this doesn’t seem to
fire at all.
Any help and pointers would be greatly appricated.
Tanks
Ryan