Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by jim_raynor,
30. Apr 2006
Ha, wenn du mal in der Hilfe zu default schaust steht da:
Ergo. Gibts für Strings keinen Default wert.
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by jim_raynor,
30. Apr 2006
Bei GetPropInfo bekommst du einen Pointer auf einen Record TPropInfo zurück, der ein Feld Default hat. Da der allerdings nur ein LongInt ist, weiß ich net, was bei einer String-Property drin steht. Vielleicht garnichts, vielleicht aber auch der richtige String, bei einem entsprechende Cast:
var
PropInfo: PPropInfo;
begin
PropInfo:=GetPropInfo(Form1,'Caption');
...
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by jim_raynor,
29. Apr 2006
Du müsstest mit GetObjectProp(Label1,'Font') das Schrift-Objekt ermitteln und dann wieder mit SetStrProp(Font,'Name','Test') setzen.
var
tmpObject: TObject; // TObject da tatsächliche Klasse zur Laufzeit unbekannt ist und auch egal ist
begin
tmpObject:=GetObjectProp(Label1,'Font');
SetStrProp(tmpObject,'Name','Test);
end;