[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3196
  • Last Modified:

Resize Child Forms to fit in Parent Form when Resized

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
Sheritlw
Asked:
Sheritlw
  • 2
1 Solution
 
SheritlwAuthor Commented:
Found answer.  For anyone that is having the same problem...
Set your child forms Start Up Position to Manual.  

0
 
djon2003Commented:
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
 
SheritlwAuthor Commented:
Exactly what I was looking for.
Thank you
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now