Autor Beitrag
raiha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: So 13.03.05 12:09 
Hi,

ich lege in einem Formular dyn. eine RadioGroup mit (je nach fall) unterschiedlich vielen RadioButtons an.
Nun möchte ich gern auswerten wenn einer der RadioButtons angeklickt wurde. Wie spreche ich die Radiogroup/Buttons an? Gibt es für solche dyn. Sachen auch ein onclick Ereignis? Wo kann ich das einstellen.
Zur Laufzeit erstellte Komponenten tauchen ja (leider) nicht im Objektinspektor auf.

Danke Rainer
demo88
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Ubuntu 6.04, Win XP
Delphi 7
BeitragVerfasst: So 13.03.05 13:19 
Du kannst die aber so zur Laufzeit zuweisen:

Bevor du ihn erstellst:

ausblenden Delphi-Quelltext
1:
RButton.OnClick:=RadioButtonXClick;					


Und die Prozedur muss dann schon existieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.RadioButtonXClick(Sender: TObject);
begin
  ShowMessage('Der Radiobutton '+(Sender as  TRadioButton).Name+' wurde gedrückt');
end;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
raiha Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: So 13.03.05 15:17 
danke super tipp :-)
funst
demo88
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Ubuntu 6.04, Win XP
Delphi 7
BeitragVerfasst: So 13.03.05 20:43 
kp
nochmal kurz ne frage...wieso das hier:
Zitat:

Moderiert von raziel: Code- durch Delphi-Tags ersetzt.


ich bin mir hundert pro sicher das ich den code in delphi tags gesetzt hab??