Forum: Object-Pascal / Delphi-Language
by Delphi.Narium,
5. Feb 2024
Deshalb prüfe ich mit if Assigend(aComp)
deshalb prüfe ich mit and (aComp is TGraphicControl)
und mit dem anschließenden then TGraphicControl(acomp).Height := 200; sollte die Zuweisung auf height erst dann erfolgen, wenn acomp sowohl etwas zugewiesen wurde, also nicht Nil ist, dieses Etwas vom Typ TGraphicControl ist und damit über das Attribut Height von TGraphicControl geerbt haben...
Forum: Object-Pascal / Delphi-Language
by Delphi.Narium,
4. Feb 2024
Weder prüfst Du, ob aComp überhaupt was zugeweisen wurde, also FindComponent erfolgreich war, noch prüfst Du, ob aComp überhaupt vom Typ TGraphicControl ist.
if Assigend(aComp) and (aComp is TGraphicControl) then TGraphicControl(acomp).Height := 200;