Checking the state of a checkbox in VS2019 .NET 4.7.03 Windows Application using C#?

  • Thread starter Thread starter Razze100
  • Start date Start date
R

Razze100

Guest
Hello!


I have a windows forms application is VS2019 with a checkbox that i want to do one thing if it is checked and another if it isn't checked at the press of a button.


Let's say my code is this:

private void Button_Click(object sender, RoutedEventArgs e)

{

if (checkbox1 is checked, do this)

{

(Code if checkbox1 is checked)

}

else

{

(Code if checkbox1 isn't checked)

}

}




Having a background of coding in VS2017 and with C# i used to just be able to use Checkbox1.Checked = true for this but now it seems like the ".Checked" part is an event and not a propertie.

I am using VisualStudio Community 2019 version 16.1.1 with .NET Framework 4.7.03190 on windows 10.

Continue reading...
 
Back
Top