MDI child windows' position

  • Thread starter Thread starter snow
  • Start date Start date
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!
 
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
 
Back
Top