Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Mi 14.05.03 10:40 
Hallo,

Habe eine allgemeine Frage zur RadioGroup. Wenn ich also mit dem ItemEditor RadioButtons erstelle kann ich jede extra ansteuern. Also jede RadioGroup kann extra eine checked beinhalten.

Wie kann ich nun ein Item meiner Wahl schon checked machen. Wie bei den normalen RadioButtons mit Checked = true? Wie kann ich abfragen ob in der RadioGroup welcher Item gesetzt ist oder nicht?

Vielen Dank.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 14.05.03 10:58 
ausblenden Quelltext
1:
RadioGroup1.ItemIndex := 0;					

Aktiviert den ersten.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 14.05.03 18:39 
und wenn du von der eigenschaft liest bekommst du den index des gecheckten items !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Di 20.05.03 12:14 
Danke für die Antworten.

:lol: Eine Frage habe ich noch.

Wie kann ich nun abfragen ob ZB die erste oder zweite gecked ist?

ZB If RadioGroup1.items[0]. ????
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Di 20.05.03 12:18 
So:

ausblenden Delphi-Quelltext
1:
2:
3:
If RadioGroup1.ItemIndex=???
Then Tue was
Else Tue was anderes

_________________
Hasta La Victoria Siempre
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 20.05.03 12:18 
ausblenden Delphi-Quelltext
1:
RadioGroup1.items[0].					

Hast du dir da mal die Schnellhilfe anzeigen lassen? Warte mal bis sie kommt nach dem du den Punkt gemacht hast. Da müßtest du eigentlich was passendens finden. :wink:
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 20.05.03 12:21 
Ach Mist. Items ist ja vom Typ Strings.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 21.05.03 14:43 
jo itemindex heisst das zaubär wort !!!

du kannst das auch mit case machen !!!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
case radiogroup1.itemindex of 
0: tuewas;
1:tuewas;
// undsoweiter
end;

_________________
In the beginning was the word.
And the word was content-type: text/plain.