Question how to change location of panel?

lul

New member
Joined
Mar 7, 2009
Messages
4
Programming Experience
1-3
hi to all.

i want the panel to center itself evertime i change the size of the window. how do i do it? panel1.location.x=form1.location.x doesent work.
 
Short and simple you want to take half of the form's width and subtract half of the panel's width to center it horizontally, same for vertically
VB.NET:
Panel1.Location = New Point((Me.Width / 2) - (Panel1.Width / 2), (Me.Height / 2) - (Panel1.Height / 2))
 
Back
Top