How to center layout

Asked

Viewed 1,436 times

0

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

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • use the Achor properties. If you want it to increase according to the form, leave all marked, otherwise uncheck all

  • I don’t want it to grow, I want it to stay centered and the same size.

  • so the "otherwise, clear all." As the colleague answered below, leave as 'None''

  • Sure! Thank you very much!

2 answers

1


In the element properties, you will find the option Layout and define the Anchor for None.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • It worked out! Thank you very much!

0

you tbm can 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: the container is nothing more, than its container.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.