The help indicates that adding gboGroupStyle to the ButtonOptions on a TButtonGroup "Specifies that the buttons should inherit the group style that is set on the container." But this explanation still leaves me lost - any ideas?
The gboGroupStyle
option in the TButtonGroup.ButtonOptions
property has nothing to do with GroupIndex
as it's known e.g. from TSpeedButton
.
Setting of the gboGroupStyle
option to True
allows you to:
TButtonGroup.ItemIndex
property, so you can predefine which button will be focused as default, nothing coolTGrpButtonItem.OnClick
event of the button item (if assigned), perform its action, or fire the TButtonGroup.OnButtonClicked
eventI agree the name of this is quite misleading, but that's what I found in the source code from Delphi-XE2.
gboGroupStyle makes the TButtonGroup act as a group - that means, one and only one button is selected at a given time. It is similar to grouping several TSpeedButtons with the GroupIndex, where only one button inside that group is selected at any time. The currently selected button can be read and written via the ItemIndex property of TButtonGroup. To visualize the selected button one can implement an OnBeforeDrawButton or OnDrawButton handler.
From my experimentation it looks like if gboGroupStyle is used then the ItemIndex property can be set to something other than -1, so that the TButtonGroup remembers the last button that was pressed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With