Wednesday, October 27, 2010

Classes and radiobuttons

Here is the form:



Here is the radiobutton code:

private void button1_Click(object sender, RoutedEventArgs e)
{
if (radioButton1.IsChecked==true)
{
MessageBox.Show("the tip is 10%");
}
if (radioButton2.IsChecked==true)
{
MessageBox.Show("the tip is 15%");
}
if (radioButton3.IsChecked==true)
{
MessageBox.Show("the tip is 20%");
}
}

No comments:

Post a Comment