Cell Editing Techniques > In-cell Buttons > Rendering cells as command buttons |
To render the current cell as a non-editable command button within a Column object, set its ButtonText property to True on the Splits property page. Or, in code:
Example Title |
Copy Code
|
---|---|
TDBGrid1.Columns(0).ButtonText = True |
When a cell within the column receives focus, it is rendered as a standard Windows command button using the cell text as the caption. The cell text is not centered automatically, but respects the column's horizontal and vertical alignment settings.
If both the Button and ButtonText properties are True, the ButtonText property takes precedence.
As with the default in-cell button, you can set the column's ButtonAlways property to True to force all of its cells to be displayed as command buttons. Only the current cell is drawn with a focus rectangle, however.