silverlight 五开发【vb版】(9)- RadioButton和ListBox

silverlight 5开发【vb版】(9)- RadioButton和ListBox
Partial Public Class MainPage
    Inherits UserControl

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub RadioButton1_Checked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles RadioButton1.Checked
        Label1.Content = RadioButton1.Content
        listbox_add(Label1.Content)
    End Sub

    Private Sub RadioButton2_Checked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles RadioButton2.Checked
        Label1.Content = RadioButton2.Content
        listbox_add(Label1.Content)
    End Sub

    Private Sub RadioButton3_Checked(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles RadioButton3.Checked
        Label1.Content = RadioButton3.Content
        listbox_add(Label1.Content)
    End Sub
    Private Sub listbox_add(stritem As String)
        ListBox1.Items.Add(stritem)
    End Sub
End Class

 
silverlight 五开发【vb版】(9)- RadioButton和ListBox
 对于RadioButton来说,GroupName一致即它们之一只能有一个被选中