Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finally, handling resizes and and MDI's scrollbar.

5 views
Skip to first unread message

Brian Tkatch

unread,
Jul 27, 2006, 3:52:04 PM7/27/06
to
Been trying to figure out how to resize forms indside an MDI Form, when
the form itself is resized dynamically, to maximize and anchors do not
help.

The problem was getting the size of the scrollbars, and effecting the
resize at the right time.

For me, the answer was finding the MDIClient and AddHandlering its
Layout event.

MDIClient is the client area inside the MDI form, in my case, without a
scrollbar, MDIClient.ClientRectangle.Width was 4 less the
MDI.Rectangle.Width (must be two pixels for each of the MDI's borders).
With a scrollbar it jumped to 20 (likely the scrollbar is 16 pixels
wide).

Getting the MDIClient (as found in the newsgroups) is done with a
ForEach cycling through all controls in the MDI's control collection
and finding the one with the type MDIClient. Should probably be index
of 0, unless the user makes it an MDI in the code after other controls
are added.

The second thing was handling those scrollbars. That is done by the
MDIClient's layout event, at which time, the scrollbars et al have been
taken into account. Since the MDIClient is not there right away, the
Handler must be refered to in the code. The declaration of the
MDIClient's Layout event is the same as the MDI's Layout event.

B.

0 new messages