Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening MDIChild Form as Maximized???

Status
Not open for further replies.

DMG2000

Programmer
Aug 13, 2000
52
0
0
US
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?

Thanks for your help!
 
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.

I hope this helps.
 
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.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top