vcl-dxtoggleswitch-989a9ccd.md
The base class for toggle switch editors.
TdxCustomToggleSwitch = class(
TcxCustomCheckBox
)
A toggle switch is a touch-friendly equivalent of a check box. Three available thumb positions in a toggle switch editor correspond to checked, unchecked, and intermediate states of a check box editor.
Users can drag the thumb, click the editor, or press the Space key when the editor has focus to switch between available check states.
The list below outlines key members of the TdxCustomToggleSwitch class. These members allow you to configure toggle switch editors.
Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly
Allow you to define individual appearance settings for different editor states.
Tip
To apply the same style settings to multiple editors, use a TcxEditStyleController component. If you need to apply the same style settings to all editors in your application, you can use a TcxDefaultEditStyleController component.
StylesProvides access to individual styles applied to the editor in different states.TransparentSpecifies if the editor is transparent in GDI render mode.
Specify the toggle switch editor’s state.
Note
The intermediate editor state is available only if the Properties.AllowGrayed property is set to True.
EditValueSpecifies the edit value.OnEditingAllows you to prevent users from activating the editor.
ActivePropertiesProvides access to the current editor settings regardless of their source. This property set does not allow you to customize editor settings.GetPropertiesClassReturns the actual editor settings type.PropertiesAllows you to customize editor settings directly if the editor does not have an assigned repository item.RepositoryItemSpecifies a repository item as an external source of editor settings. A repository item has priority over other editor settings.
EnabledSpecifies if the editor is enabled.CanModifyIdentifies if the editor is in read-only mode.IsEditValidating | IsHiding | IsPostingAllow you to identify the current operation in the editor.ShowHintSpecifies if the standalone editor can display hints. To enable hints for an in-place editor in a container control, set its OptionsBehavior.CellHints[1] property to True.Width | HeightAllow you to explicitly define editor dimensions.
The following code example configures state indicators of an existing unbound toggle switch editor:
dxToggleSwitch1.Caption := 'Action History';
dxToggleSwitch1.Properties.StateIndicator.OffText := 'Off';
dxToggleSwitch1.Properties.StateIndicator.OnText := 'On';
dxToggleSwitch1.Properties.StateIndicator.Kind := sikText;
dxToggleSwitch1.Properties.StateIndicator.Position := sipInside;
dxToggleSwitch1->Caption = "Action History";
dxToggleSwitch1->Properties->StateIndicator->OffText = "Off";
dxToggleSwitch1->Properties->StateIndicator->OnText = "On";
dxToggleSwitch1->Properties->StateIndicator->Kind = sikText;
dxToggleSwitch1->Properties->StateIndicator->Position = sipInside;
Do not use the TdxCustomToggleSwitch class directly. Use the following descendants instead:
TdxToggleSwitchAn unbound toggle switch editor.TdxDBToggleSwitchA data-aware toggle switch editor.
Show 13 items
TObject TPersistent TComponent TControl TWinControl TCustomControl TcxCustomControl TcxControl TcxContainer TcxCustomEditContainer TcxCustomEdit TcxCustomCheckBox TdxCustomToggleSwitch
Footnotes
True or False to enable or disable in-place editor hints in corresponding container controls:See Also