How to center layout

0

I want to center this panel, even when the screen is maximized, I want it to stay centered. And not as it is.

    
asked by anonymous 08.12.2017 / 12:24

2 answers

1

In the properties of the element, you will find the Layout option and set Anchor to None .

    
08.12.2017 / 12:36
0

You can also do via code:

Knowing that the center of the Container is half its width .Width / 2 and half its height .Heigth / 2

control.Top = (Container.Heigth / 2) - (control.Heigth - 2);

control.Left = (Container.Width / 2) - (control.width - 2);

Note: Container is nothing more than your container.

    
08.12.2017 / 22:24