skip to Main Content

Searched all over Google and I’m afraid I can’t find an answer to this.

Here is my current situation:
Before

Instead of having those checkbox aligned to the left I want them centered like so (photoshopped obviously):
enter image description here

Anybody know how to achieve this with VCL? Thanks.

Edit:
These components are inside a TGridPanel and for whatever reason the Left and Top properties have no effect on the position of the component in the cell. I have also looked for any layout properties with no luck.

2

Answers


  1. Chosen as BEST ANSWER

    I managed to find a solution although it's rather messy. But for future reference I had to create a panel for every single cell in my GridPanel then that allowed me to set the left padding property of the panel to push my TCheckboxes over.

    enter image description here



    Yes it's super inefficient but it's the best I've got so far. Also fixes my issue of wanting to show the cell outlines inside the GridPanel.


  2. The controls inside the TGridPanel are automatically center-aligned. If you reduce the width of the checkboxes to the correct value it should be centered as requested. Be aware that if you reduce the size too much the checkbox will shrink.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search