Problem with MDI child form behavior

G

Guest

I'm working on a C# program in Visual Studio 2003. The main form has a
treeview control on the left side, a splitter, and the right side of the
splitter has nothing and is used as the MDI client area. I have several MDI
child forms open (typically maximized) and can pick which child form has
focus by clicking on it's node representation in the treeview control. The
event handler for the treeview figures out which mdi child form is associated
with the selected node and does Child.Focus().

Everything works fine, except one of my forms. It is fairly long, has
AutoScroll = true, and has a vertical scrollbar even when maximized, because
of the length of the form. The form will look normal the first couple of
times I choose it's node (is maximized with a scrollbar). But eventually when
I select another form, then switch back to this form it will be resized as if
the windowstate is "Normal", even though it is actually "Maximized". The
middle controlbox button shows as if the form is maximized and I can see the
other child form maximized behind it.

If I click the "maximize" controlbox button, it will stay it's same size,
but switch to "Normal" windowstate, where I can click the "maximize" button
again to maximize it to the proper view. Also, if I've switched to this child
form so that it is in this messed up state and just start to resize the main
parent form, the mdi child form will immediately snap into the proper
maximize state. If I turn "AutoScroll" off, the child form won't ever go into
this weird state, but I don't have the scrollbar, which is needed.

This seems like a bug with the .NET framework that others might have come
across. Does anyone know what's happening or a solution?
 
G

Guest

I discovered a new trick to this. When I'm in the VS form designer and
decrease the form size so it's smaller than the area it's controls are in,
the scrollbar shows up in the design view (because some of it's controls are
outside of view of the form size). When I run the program with the smaller
default child window size, the problem doesn't appear. But when I maximize
the main form the problem happens again (this didn't happen before when the
form was maximized). Has anyone come across this bug before?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top