sweetfriend9
New member
- Joined
- Jul 25, 2017
- Messages
- 2
- Programming Experience
- Beginner
HI ,
I am making simple windows form application ( screenshot attached ) , both the radio buttons when checked are giving the subtraction result for the below mentioned code :
I am making simple windows form application ( screenshot attached ) , both the radio buttons when checked are giving the subtraction result for the below mentioned code :
private void ClearButton_Click(object sender, EventArgs e) { FirstNumberTextBox.Clear(); SecondNumbereTextBox.Clear(); ResultTextBox.Clear(); FirstNumberTextBox.Focus(); AdditionRadioButton.Checked = true; } private void CalculateButton_Click(object sender, EventArgs e) { int firstNum = Convert.ToInt32(FirstNumberTextBox.Text); int secondNum = Convert.ToInt32(SecondNumbereTextBox.Text); int result = 0; if (AdditionRadioButton.Checked == true) ; { result = firstNum + secondNum; } if (SubstractionRadioButton.Checked == true) ; { result = firstNum - secondNum; } ResultTextBox.Text = result.ToString(); } } }
Attachments
Last edited by a moderator: