Get the height value of a parent form

I have a mdi form and a child form. i want to adjust the height and width of the child form based on that of the parent form

I am putting code:

me.height = me.parentform.height

I do this during the form load procedure of the child form.

Unfortunately me.parentform.height = nothing at this time.

how can i get  the hieght of the parent form?

Anthony MatovuBusiness Analyst, MTN UgandaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

As a first step, move code to Shown  even instead of Load. Then, use me.MDIParent.Height

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jacques Bourgeois (James Burger)PresidentCommented:
Depending on what you want to do, you might use the Dock property of the child so that it adjusts automatically to the height. For instance, setting the Dock property to DockStyle.Left shows the form full height on the left side of the parent. You can adjust the Width as desired.

Playing with Dock enables you to perform a few tricks that are easier done that way than by controlling everything.

As an example, if after doing what I explained, you open a second form set with DockStyle.Fill, it will fill up all the available space in the right part of the parent. And if the user enlarge the Parent, the first form will automatically adjust its height, while the second form will automatically enlarge.

Note that this way, you can do the job in the Load event.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.