Recent

Author Topic: Best way to create a button grid in lazarus?  (Read 293 times)

randohinn

  • New Member
  • *
  • Posts: 13
Best way to create a button grid in lazarus?
« on: July 14, 2020, 10:58:20 pm »
What's the best component or package to create a grid of buttons with n rows m columns of equal size cells, where I could just set the row and column indexes for the individual buttons?

jamie

  • Hero Member
  • *****
  • Posts: 3648
Re: Best way to create a button grid in lazarus?
« Reply #1 on: July 14, 2020, 11:02:30 pm »
TDrawGrid maybe ?

That gives you the grid where you can custom draw on the cells the image you want that could behave like buttons.

 
Or TFlowPanel
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 7628
Re: Best way to create a button grid in lazarus?
« Reply #2 on: July 15, 2020, 12:04:34 am »
No special component needed, just use the ChildSizing property of the container. See attached demo.

[EDIT]
Sorry, I mixed up n and m in the demo.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018