Skip to main content

TcxCustomEditProperties.ClearKey Property

Specifies the keyboard shortcut to clear the editor entry.

Declaration

property ClearKey: TShortCut read; write; default 0;

Property Value

Type Default
TShortCut 0

Remarks

By default, the ClearKey property is not specified.

Use the ClearKey property to specify the shortcut that is used to remove the contents within the editor. This operation forces the editor to set the EditValue property to Null.

The following code creates a TcxEditRepositoryExtLookupComboBoxItem repository item and sets its ClearKey property to the Alt+C key combination. The repository item is created using the existing TcxEditRepository component (cxEditRepository1). See the repository and repository items section for more information.

var
  ARepositoryItem: TcxEditRepositoryLookupComboBoxItem;
//...
ARepositoryItem := 
  TcxEditRepositoryLookupComboBoxItem(cxEditRepository1.CreateItem(
  TcxEditRepositoryLookupComboBoxItem));
with ARepositoryItem.Properties do
begin
  //...
  ClearKey := TextToShortCut('Alt+C');
end;
//Assign the repository item to an existing LookupComboBox editor
cxLookupComboBox1.RepositoryItem := ARepositoryItem;
//...
//Delete the repository item when you finish working with it
ARepositoryItem.Free;

The default value of the ClearKey property is 0.

See Also