Einzelnen Beitrag anzeigen

moelski

Registriert seit: 31. Jul 2004
1.110 Beiträge
 
Delphi 2010 Professional
 
#3

Re: Eigenschaften auf "Vorhandensein" prüfen?

  Alt 15. Jan 2009, 18:03
Moin !

Jung ik zieh mein Hut

Das geht ja noch einfacher als gedacht:
Delphi-Quellcode:
procedure TLVMainForm.PopupSeriesPopup(Sender: TObject);
Var Serie : TChartSeries;
    PropInfo : PPropInfo;
begin
  Serie := ChartListBox1.SelectedSeries;
  if (Serie = NIL) Then Exit;

  // Serie.GetVertAxis.Maximum -> Serie.GetVertAxis.ClassInfo
  { Get info record for Enabled property }
  PropInfo := GetPropInfo(Serie.ClassInfo, 'DrawAllPoints');
  { If property exists, set value to False }
// if Assigned(PropInfo) then
// DrawAll1.Caption := 'Text : ' + FloatToStr(Serie.GetVertAxis.Maximum);
  DrawAll1.Enabled := Assigned(PropInfo);
end;
Mit zwei zeilen Code kann man das abhandeln. Hab jetzt schon mit 4-5 Properties getestet und geht wunderbar!
Das spart mir mal wieder ganz ganz viel Zeit.

Drum sag ich DANKE
Dominik Schmidt
Greetz Dominik

I love Delphi 2007/2010
  Mit Zitat antworten Zitat