Home > Mobile >  Resizing Panels in proportion to form
Resizing Panels in proportion to form

Time:10-01

I am developing a Delphi game for my (grade 10) PAT.

I am using an image as a grid for my game and placing individual panels in each grid because I do not know how to use string grids as it's my first year with Delphi. When I place the panels perfectly in each grid of the image and run my code everything looks normal until I go full screen,then all the panels are in each grid but the size is not in proportion with the image as I placed it before. A solution would be much appreciated. Thanks in advance.

CodePudding user response:

Use a TGridPanel in place of your image. Each panel goes into one cell of the grid, and with the column widths and row heights set as a percentage (which is the default), and both the grid and the panels in the grid having Align set to alClient, the cells, and therefore the panels, will adjust their size proportional to the entire form.

  • Related