I keep getting this error when making the program as given below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sys
Checked
here is an event, not a bool
, that happens when it is checked. You need a different property - presumably IsChecked.
Minor note, but stylistically, it is usually preferable not to compare booleans to true
/false
, but rather:
if (rbadd.IsChecked)
c = a + b;
else if (rbsubtract.IsChecked)
c = a - b;
else if (rbdivide.IsChecked)
c = a / b;
etc; or if you wanted to test for false
: if(!rbadd.IsChecked)
.