3

If you drop a FMX.TStringGrid onto a new FireMonkey form, the grid gets shown with a thin border.

If you drop a FMX.TTListView onto the form, there is no border.

Neither component seems to have a property for enabling/disabling the border, or setting the border colour or width.

I assume this is due to the cross-platform requirement, so how should it be done? Do I need to add a panel, then put the listview inside the panel? Or is it something to do with the style, as in needing a TStyleBook?

Mike Torrettinni
  • 1,759
  • 2
  • 12
  • 39
SiBrit
  • 1,225
  • 9
  • 30

1 Answers1

4

Yes, the TListView has no border. Firemonkey offers several ways to add a border to any visual control. For adding a simple border I would not try to change the styles.

In my opinion, the simplest solution is to put a rectangle from the palette (from Shapes) into the form. Set in the rectangle the Stroke to the desired color and thickness. As the next step, go to the structure-view in the designer and move the Listview as a child element into this rectangle. Change the Align property of the listview to Client. To display the border-lines again, you must set all the values ​​for Padding (bottom, left, right and top) of the rectangle to the value thickness of the rectangle stroke.

If you like you can also add a TShadowEffect on your rectangle or listview control.