MDI child windows' position

S

snow

Hi all,

I want to display two child windows at the same time, one on the top
and the other on the bottom. I set each window's Left and Top
properties. For example:

form1.Left = 0
form1.Top = 0

form2.Left = 0
form2.Top = form1.Top + form1.Height

form1.show()
form2.show()

but it doesn't work, form2 overlap form1 partially.

How to make form2 display right below form1?

Thanks!
 
S

Stephany Young

Try 'showing' form1 first:

form1.Left = 0
form1.Top = 0
form1.show()

form2.Left = 0
form2.Top = form1.Top + form1.Height
form2.show()

By the way, a form has a Bottom property which is the sum of it's Top and
Height properties, therefore you can simply use:

form2.Top = form1.Bottom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top