Ersatz für Radiobutton durch Checkbox realisieren?
Hallo Leute
Gibt es für so ne situation eigentlich eine nicht so umständliche Alternative? Mir ist da auf die schnelle nichts anderes eingefallen (Ausgenommen Listbox).
MFG
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Public[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Class[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]MainPage[/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Public[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] box_Nr [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]As[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Integer[/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Private[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Sub[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] Deselect(boxNr [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]As[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Integer[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas])[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]' Alle buttons Deselektieren bis auf den ausgewählten[/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Select[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Case[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] boxNr[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Case[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] 1[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas] CheckBox1.IsChecked = True[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox2.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox3.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox4.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox5.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]boxNr = 0[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]Case[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] 2[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox1.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox2.IsChecked = True[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox3.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox4.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]CheckBox5.IsChecked = False[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]boxNr = 0[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]' USW bis Case 5[/FONT][/FONT][/FONT]
[FONT=Consolas] [FONT=Consolas][FONT=Consolas][FONT=Consolas]End[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Select[/FONT][/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas][FONT=Consolas]End[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Sub[/FONT][/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas][FONT=Consolas]Private[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Sub[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] CheckBox1_Checked(sender [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]As[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] System.[/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Object[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas], e As [/FONT][/FONT][FONT=Consolas][FONT=Consolas]System.Windows.[/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]RoutedEventArgs[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]) [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Handles[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]_ CheckBox1.Checked[/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas] Deselect(1)[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]End[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]Sub[/FONT][/FONT][/FONT]
' USW bis Listbox 5
[FONT=Consolas][FONT=Consolas][FONT=Consolas]EndClass[/FONT][/FONT][/FONT]
[/FONT]
[FONT=Consolas][/FONT]
[FONT=Consolas]
[/FONT]
AW: Ersatz für Radiobutton durch Checkbox realisieren?
Wobei mir die Idee statt Radiobuttons Checkboxen mit dem Verhalten von Radio-Buttons zu verwenden so überhaupt nicht gefällt - immerhin kann der User normal bei den Steuerelementen ja schon durch deren Aussehen auf die Funktion schließen => potentielle Verwirrung wenn dann Checkboxen sich wie Radio-Buttons verhalten.
Ansonsten ist die von Uwe genannte Variante tatsächlich die vom Programmcode her kürzeste.
AW: Ersatz für Radiobutton durch Checkbox realisieren?
OK danke für eure Hilfe, ist ja nur ein kleines projekt für mich selber^^