RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolButton.Grouped Property

Aggregates a sequence of adjacent tbsCheck buttons.

Pascal
property Grouped: Boolean;
C++
__property Boolean Grouped;

When an unbroken sequence of adjacent tool buttons each has its Grouped property set to true and Style set to tbsCheck, then no more than one of the buttons can be selected at the same time. Selecting a grouped button at runtime unselects the other buttons in its group. 

To create distinct groups of buttons within a toolbar, separate the groups with any of the following: tool buttons whose Grouped property is false, tool buttons whose Style property is not tbsCheck (tbsSeparator and tbsDivider buttons are useful for this), or controls other than tool buttons.  

C++ Examples: 

 

/*
To create a toolbar that corresponds to an existing menu:

1   Drop a ToolBar on the form and add a ToolButton for each
  top-level menu item you wish to create.
2   Set the MenuItem property of each ToolButton to correspond
  to the top level menu items.
3   Set the Grouped property of each ToolButton to true.
4   Clear the Menu property of the Form (if it is assigned)
5   Set the Visible property on the ToolBar and ToolButtons to
  true.
6   Set the ShowCaptions property on the ToolBar to true.
7   Set the MenuItem | Visible property of each ToolButton to
  true.
*/

 

Delphi Examples: 

{
To create a toolbar that corresponds to an existing menu:

1   Drop a ToolBar on the form and add a ToolButton for each top-level menu item you wish to create.
2   Set the MenuItem property of each ToolButton to correspond to the top level menu items.
3   Set the Grouped property of each ToolButton to true.
4   Clear the Menu property of the Form (if it is assigned)
5   Set the Visible property on the ToolBar and ToolButtons to true.
6   Set the ShowCaptions property on the ToolBar to true.
7   Set the MenuItem | Visible property of each ToolButton to true.
}

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!