FOLLOW US
softpcapps Software CODE HELP BLOG

Shareware and free Open Source Windows Software Applications and free Online Tools

How to Center any Control on the Form

To center horizontally any control on the form or on its parent control you can use the following :
	

	mycontrol.Left=mycontrol.Parent.Width/2-mycontrol.Width/2;	

To center vertically any control on the form or on its parent control you can use the following :
	
	
	mycontrol.Top=mycontrol.Parent.Height/2-mycontrol.Height/2;