Is there a way to open a MDI child form so that it is maximized in the parent window? Also, on the same note, is it possible to set scroll bars in the parent window if the MDI child is bigger than the parent window, but not on load? Thanks!
Yes. You can do this by setting a WindowState property for Form1 either in design-time, or in run-time. Setting it to value 2 (vbMaximized) will maximize this window. Note that this can be done either before or after showing the form.
About scrollbars, MDIForm has a scrollbar property which can be set to show the scrollbars if necessary.
Alright, the windowstate helped! But the MDIForm scrollbar property set to true does not display a v scroll bar as needed. Do I need to actually make scrollbar controls with the child form? And if so, is there an easy way to do this?
ScrollBars in MDIForm are shown in run-time, when the MDIForm is unable to show the child Window completely. This can be because of the position of the child form.
Try this:
When ScrollBars property of MDIForm is True, drag the child so that is goes out of scope of the MDIForm. You will see the scrollbars then on the MDI Form. Also you will see them when you enlarge the child form in code. For example set the width of the child form in MDIForm_Load event handler this way: Form1.Width = 20000
Since the MDIForm is smaller than this, you will see the horizontal scrollbars.
Ah hah....I gues it is working...my prob was when the child form loaded normal, it was small and had no scroll down, not a issue, but adding the height and width on load works excellent.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.