Solved

Resize Child Forms to fit in Parent Form when Resized

Posted on 2009-04-09
3
2,537 Views
Last Modified: 2012-05-06
I have an MDI app with several child forms.  
When the app first loads it is maximized and when a child form is opened I specify
Dim ft As New frmMembers

        ft.MdiParent = Me
        ft.WindowState = Me.WindowState
        ft.Show()

and the form fits perfectly in the MDI Parent.
But when I bring the parent to normal size, the child forms do not resize and float in the MDI Parent container.
I would like to have all mdi child forms resize to fit in the Parent when the parent is resized.
I thought that I could run through each open child form and set childform.WindowState = Me.WindowState.
Problem, I don't know how to run through each child form to change it's state...
For each childform in Me.childforms ???
If you think this is a good way to handle this, please provide an example, not a link.  My IE crashes when I click on links.
If you think there is a better way, please advice.
Thank you
0
Comment
Question by:Sheritlw
  • 2
3 Comments
 

Author Comment

by:Sheritlw
ID: 24112448
Found answer.  For anyone that is having the same problem...
Set your child forms Start Up Position to Manual.  

0
 
LVL 9

Accepted Solution

by:
djon2003 earned 500 total points
ID: 24112452
In the Resize event of your MdiParent form you could add this code :
For Each curForm As Form In Me.MdiChildren

    curForm.WindowState = Me.WindowState

Next

Open in new window

0
 

Author Closing Comment

by:Sheritlw
ID: 31568772
Exactly what I was looking for.
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now