Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Crowbar,
30. Mär 2008
@Medium:
Wenn ich
ActiveContrlName :=(C as TControl).Caption
benutze, kommt beim Kompilieren die Fehlermeldung:
"Auf protected-Symbol TControl.Caption kann nicht zugegriffen werden."
:?: :?: :?:
Gruß
Crowbar
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Crowbar,
30. Mär 2008
Ja, so klappt es!
Aber wie ist es, wenn ich das Caption von einer TForm über diese Funktion abrufe?
Man kann ja das TForm verschieden benennen, z.B. MainForm: TMainForm oder Form2: TForm2 usw.
Muß ich, um das Caption der jeweiligen TForm zu ermitteln, anders als
ActiveContrlCaption:=(C as TButton).Caption;
z.B. ActiveFormCaption:=(C as TForm).Caption; <= klappt aber nicht?
vorgehen?
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Crowbar,
29. Mär 2008
Ich bin ich es doch noch einmal...
... aber etwas Schwieriger wird es sein, wenn ich nicht weiß, ob es gerade TButton, TForm usw. ist oder?
...
Var
C,FLastActiveControl : TWinControl;
ActiveContrlClass,ActiveContrlName,
ActiveContrlCaption : String;
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Crowbar,
29. Mär 2008
@mkinzler:
Was meinst Du mit "casten"?
Hast Du ein Beispiel dafür?
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Crowbar,
29. Mär 2008
Hallo,
...
Var
C : TWinControl;
ActiveContrlClass,ActiveContrlName,
ActiveContrlCaption : String;
begin
...