Segmented controls are commonly used in iOS applications today.
In XE4, you can easily style a TSpeedButton to look and behave like a segmented control by changing the stylelookup property and defining a group name.
Below are the steps for quickly creating a (reusable) segmented control component.
- Place 3 TSpeedButton components onto your form
- Change the stylelookup property for each TSpeedButton to segmentedbuttonleft, segmentedbuttonmiddle and segmentedbuttonright
- Select all 3 TSpeedButton components and type in a GroupName (i.e. mysegments)
- If you want to have one of the segments selected by default, just set the speedbutton’s isPressed property to true.
For easy reuse in the future, select all 3 TSpeedButtons on your form (you can use Shift to multi-select), and go to Component - Create Component Template.