G
Guest
Hi Everybody,
I've got a strange problem:
While searching the newsgroups for something else,
I've come across a post that discusses a bug with restoring MDI child forms.
(for any body who is interested, the post is in
microsoft.public.dotnet.framework.windowsforms
by Scott Abel, the title is 'Form Message Question', from 2003-08-12
09:43:42 PST )
Briefly, the problem is that if you use Form.WindowStyle to restore a
minimized MDI child that was maximized when it was minimized, the form will
be restored as maximized (as it should) but then when you click on the
restore button of the from it will be restored to the minimized size.
That post also included a workaround for this bug (to use SendMessage to
send a SC_RESTORE message to the form instead of using Form.WindowState).
I have implemented this in my application.
However, I've run into a strange problem:
I have several child forms in my application.
Some are opened using a menu, and some have buttons in a toolbar to open them.
For some reason, this work around works when the code is called from a menu,
but does NOT work when the code is called from the event handler of a button
in the toolbar.
I even created a menu item that calls the event handler of the toolbar button.
When clicking on the menu item the form is restored, when clicking on the
button it is NOT restored.
Later on, I will try to reproduce this in a small application and will post
the code.
If anybody have any ideas why this happens or how to fix it, please let me
know.
Thanks
Nadav
I've got a strange problem:
While searching the newsgroups for something else,
I've come across a post that discusses a bug with restoring MDI child forms.
(for any body who is interested, the post is in
microsoft.public.dotnet.framework.windowsforms
by Scott Abel, the title is 'Form Message Question', from 2003-08-12
09:43:42 PST )
Briefly, the problem is that if you use Form.WindowStyle to restore a
minimized MDI child that was maximized when it was minimized, the form will
be restored as maximized (as it should) but then when you click on the
restore button of the from it will be restored to the minimized size.
That post also included a workaround for this bug (to use SendMessage to
send a SC_RESTORE message to the form instead of using Form.WindowState).
I have implemented this in my application.
However, I've run into a strange problem:
I have several child forms in my application.
Some are opened using a menu, and some have buttons in a toolbar to open them.
For some reason, this work around works when the code is called from a menu,
but does NOT work when the code is called from the event handler of a button
in the toolbar.
I even created a menu item that calls the event handler of the toolbar button.
When clicking on the menu item the form is restored, when clicking on the
button it is NOT restored.
Later on, I will try to reproduce this in a small application and will post
the code.
If anybody have any ideas why this happens or how to fix it, please let me
know.
Thanks
Nadav