Installing CheckState on CheckBox does not work

I am developing a WinForms application using C # with the following code:

((CheckBox)page.Controls[check_box_name]).CheckState = CheckState.Checked;

The code didn't work, so I tried refreshing the page.

page.Refresh();

It didn’t help, and I don’t know why. Can someone enlighten me?

+4
source share
2 answers

You are not saying whether you are using WPF or WinForm. The answer may be different for both. Anyway, I think in this case the problem is that you are using a variable designed to check the status, which needs to be changed for the Checked parameter for WinForms or IsChecked for WPF

0
source

? , , -, CheckBox.CheckState Disabled? , , , . , CheckBox.Checked.

0

Source: https://habr.com/ru/post/1621394/


All Articles