hat sich erledigt.. Danke trotzdem!!
habs so gelöst, dass ich nen neuen Typ deklariert habe:
Delphi-Quellcode:
....
type TMyButtonControl = class(TButtonControl);
...
...
...
function WriteIni(IniFile:String;Section:String;Key:String;TheComp:TComponent):Boolean;
Var FIni:TInifile;
begin
result:=false;
Try
FIni := TIniFile.Create(IniFile+'.Ini');
If TheComp is TCustomEdit then
begin
FIni.WriteString(Section,Key,(TheComp as TCustomEdit).Text);
result:=True;
end;
If TheComp is TMyButtonControl then
begin
FIni.WriteBool(Section,Key,(TheComp as TMyButtonControl).Checked);
result:=True;
end;
FIni.Free;
except
result:=false;
end;
end;
nu funktionierts...