Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TCheckListEdit
Events

The control TCheckListEdit has 3 non standard VCL events:

OnShowCheckList : triggered when the dropdown is shown
OnCheckListItemToText : triggered to allow to display something different in the dropdown from the edit control part
OnTextToCheckListItem : reverse event

Example:
Assume you want to show in the edit control part "G" for Germany and "F" for France, without implementing this event handler, the checklist dropdown would list "G" and "F"

These event handlers would accomplish this:
procedure TForm1.CheckListEdit1CheckListItemToText(Sender: TObject;
  var aText: string);
begin
  if aText = ''Germany'' then
    aText = ''G''
  else
  if aText = ''France'' then
    aText = ''F''
end;

procedure TForm1.CheckListEdit1TextToCheckListItem(Sender: TObject;
  var aItem: string);
begin
  if aItem = ''G'' then
    aItem = ''Germany''
  else
  if aItem = ''F'' then
    aItem = ''France''
end;