Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Center a form over another form

0 views
Skip to first unread message

Chad Miller

unread,
Dec 1, 2004, 11:50:22 AM12/1/04
to
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.


Cor Ligthert

unread,
Dec 1, 2004, 12:57:03 PM12/1/04
to
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


"Chad Miller" <ch...@predictiveconcepts.com>

0 new messages