Center a form over another form

  • Thread starter Thread starter Chad Miller
  • Start date Start date
C

Chad Miller

How can a form be centered over another form without using showdialog with
centerparent?

I have tried:

control.location = new point((me.clientsize.width / 2) - (control.size.width
/ 2), me.clientsize.height / 2) - (control.size.height / 2))

Thanks.
 
Chad,

It was a long thread yesterday with solution however never compleet.

You can try this one
\\\form1
dim frm as new form2
frm.Owner = Me
frm.Width = Me.Width - 100
frm.Height = Me.Height - 100
frm.Show()
///
\\\form2 in a place wher you want when only in startup than in load
Me.Location = New Drawing.Point((Me.Owner.Location.X + _
(Me.Owner.Width \ 2) _
- (Me.Width \ 2)), (Me.Owner.Location.Y + _
(Me.Owner.Height \ 2) - (Me.Height \ 2)))
///

I hope this helps?

Cor
 

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

Back
Top