Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#4

Re: Panel.Controls auf TShape prüfen

  Alt 20. Apr 2008, 09:38
Zitat von toms:
if Panel_MSST.Controls[i] is TShape then
Nachtrag:

Nach der "is"-Überprüfung kannst du anstatt eines Soft Casts einen Hard Cast machen:

Also anstatt:

Delphi-Quellcode:
if Panel_MSST.Controls[i] is TShape then
begin
  Dummy_Shape := Panel_MSST.Controls[i] as TShape;
end
so:

Delphi-Quellcode:
if Panel_MSST.Controls[i] is TShape then
begin
  Dummy_Shape := TShape(Panel_MSST.Controls[i]);
end
Thomas
  Mit Zitat antworten Zitat