Gehe zu deutscher Webseite

ViaThinkSoft CodeLib

This article is in:
CodeLibProgramming aidsDelphi

This behavior is useful when you are using an edit control that is used for entering search terms.

procedure TForm1.Edit1Click(Sender: TObject);
begin
  if (Sender is TCustomEdit) and (TComponent(Sender).Tag = 1) then
  begin
    TCustomEdit(Sender).SelectAll;
    TComponent(Sender).Tag := 0;
  end;
end;

procedure TForm1.Edit1Enter(Sender: TObject);
begin
  TComponent(Sender).Tag := 1;
end;
Daniel Marschall
ViaThinkSoft Co-Founder