Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomEditProperties.ClearKey Property

Specifies the keyboard shortcut to clear the editor entry.

#Declaration

Delphi
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