Solved

Resize Child Forms to fit in Parent Form when Resized

Posted on 2009-04-09
3
2,642 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice in Xamarin 21 97
get combo value in class 5 14
Import MySQL data into MS Access using VB.Net interface 5 29
Access Schema 6 26
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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 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