Home > Software engineering >  Is there any way to set a control at the center of the window with one button in some Visual options
Is there any way to set a control at the center of the window with one button in some Visual options

Time:12-30

My question is not about keeping controls in center after a resize of the window. Only thing I want to know is am I able to center controls like on the image below with some Visual Studio option and not doing it by hand?enter image description here

CodePudding user response:

If you want to set controls at the center of the window, you can refer to the following steps:

First create a TableLayoutPanel and Edit Rows and Columns.

enter image description here

Second you can edit the row and column style in this interface.

enter image description here

Then you can add you Buttons into the TableLayoutPanel like this

enter image description here

Finally just select the TableLayoutPanel and click Format on the menu and choose Horizontally under Center in Form. The controls will be set at the center of the window.

enter image description here

  • Related