Floating FB sharing byReview Results

Floating FB sharing byReview Results

  • WPF Tutorial

    • # Read in Your Language


    WPF Controls

    Tutorial Home | Layouts | Containers| Button | CheckBox and CheckedListBox | ComboBox| DateTimePicker and MonthCalendar | DataGrid | Label and LinkLabel| ListBox | ListView | TextBox and MaskedTextBox| PictureBox and ProgressBar | TreeView | WebBrowser| Menus,Status and Toolbar | RadioButton | RichTextBox| ToolTip and Scrolling | Custom Controls

    RadioButton control in WPF

    RadioButton:


    Namespace : System.Windows.Controls.RadioButton

    Designer Code:

    
    <RadioButton Margin="10,10,0,13" Name="RadioButton1" HorizontalAlignment="Left" 
            VerticalAlignment="Top" Width="180" Height="20" Background="Red" 
            Foreground="Orange" Checked="RadioButton1_Checked">
                One
    </RadioButton>
            

    Code Behind:

    
            // Window1.xaml.cs
    private void RadioButton1_Checked(object sender, RoutedEventArgs e) { bool? state = RadioButton1.IsChecked; }




    This is a ToggleButton.

    Grouping of Radio Buttons:

    If you want RadioButtons to participate in the same “Group” when parented to different panels, use GroupName=”myGroup”.

    
     <StackPanel>
     <RadioButton Margin="10,5,0,0" GroupName="MyGroup" Background="Orange" 
     Foreground="Blue" >
         one
     </RadioButton>
     <RadioButton Margin="10,5,0,0" GroupName="MyGroup" Background="Orange" 
     Foreground="Red" >
         Two
     </RadioButton>
     <RadioButton Margin="10,5,0,0" GroupName="MyGroup" Background="Orange" 
     Foreground="Green" >
         Three
     </RadioButton>
     <RadioButton Margin="10,5,0,0" GroupName="MyGroup" Background="Orange" 
     Foreground="Pink" >
         Four
     </RadioButton>
     </StackPanel>
            




    << Previous >> | << Next >>