Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.024 Beiträge
 
Delphi 12 Athens
 
#2

AW: TabSheet aktivieren auf dem ein Control ist

  Alt 6. Jul 2021, 14:54
Gibt es einfachere Lösungen
Gibt es:
Delphi-Quellcode:
procedure ForceFocus(const AControl: TWinControl);
var
  control: TControl;
begin
  control := AControl;
  while control <> nil do begin
    if control is TCustomForm then Break;
    if control is TTabSheet then
      TTabSheet(control).PageControl.ActivePage := TTabSheet(control);
    control := control.Parent;
  end;
  AControl.SetFocus;
end;
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat