Einzelnen Beitrag anzeigen

shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#2

Re: Variable von Typ TForm in andre Unit überbeben

  Alt 15. Nov 2005, 13:58
Delphi-Quellcode:
procedure Test(AForm: TForm);
begin
  Assert(Assigned(AForm)); // Parameter darf nicht nil sein

  // durchaus möglich, dass kein Control aktiv ist
  if Assigned(AForm.ActiveControl) then
     ShowMessage(AForm.ActiveControl.Name)
  else
     ShowMessage(AForm.Name+': kein Control aktiv');
end;
Andreas
  Mit Zitat antworten Zitat