Home All Groups Group Topic Archive Search About

toolbar separator causes System.OutOfMemoryException

Author
26 Feb 2006 7:23 PM
ari
I have a small form that comprises a toolbar, a treeview and a status
bar.

Everything was working fine until I decided to add a new button to the
toolbar - and I decided for appearances sake to add a separator button
to distance the new button from the old ones. When I do "show" on the
form (which is an mdi-child) I get the following exception:

System.OutOfMemoryException occurred in system.windows.forms.dll

Additional Information: Error Creating Windows Handle

When I delete the separator, everything works fine again. If I change
the separator into a regular button, it works fine.

Anyone encountered a problem like this? Anyone have any ideas?

I am using framework version 1.1.4322 and visual studio version (2003)
7.1.3088

Author
26 Feb 2006 9:23 PM
ShaneO
ari wrote:
Show quoteHide quote
> I have a small form that comprises a toolbar, a treeview and a status
> bar.
>
> Everything was working fine until I decided to add a new button to the
> toolbar - and I decided for appearances sake to add a separator button
> to distance the new button from the old ones. When I do "show" on the
> form (which is an mdi-child) I get the following exception:
>
> System.OutOfMemoryException occurred in system.windows.forms.dll
>
> Additional Information: Error Creating Windows Handle
>
> When I delete the separator, everything works fine again. If I change
> the separator into a regular button, it works fine.
>
> Anyone encountered a problem like this? Anyone have any ideas?
>
> I am using framework version 1.1.4322 and visual studio version (2003)
> 7.1.3088
>
I've had similar experiences with VS2005 under Framework 2.0 except all
my ToolStrip Controls would simply disappear from the ToolStrip and the
only way I could get them back was to revert to an earlier version of
the application!

In my case, it appeared to be caused by a combination of setting
AutoSize=False and adding enough Controls to cause the ToolStrip to
trigger the Overflow Menu.

I overcame it by reducing the Width of individual Controls on the ToolStrip.

Hope this might help you.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Author
27 Feb 2006 8:13 AM
ari
Thanks Shane - I don't think this is the case: I only have four buttons
on the toolbar, and I wanted to add a separator and one more button....