FOLLOW US
softpcapps Software CODE HELP BLOG



Freeware Open Source Windows Software Applications and Free Online Tools

For Windows 11 : Download and run .NET 3.5 Installer if the application is not running

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;