c# - CheckBox does not update -


i using checkbox toggle button (checkbox.appearance = appearance.button) in child form. if users presses button measurement cycle start if criteria satisfied (e.g. temperature within range). checkbox.checked property remains true until measurement completed.

if e.g. temperature out of range warning appear , button reset. same happens if cycle ended properly. in end self-explaining function called:

    /// <summary>     /// resets button states false     /// </summary>     public void resetbutton()     {         checkbox_start.checked = false;     } 

now, when debugging, see checkbox_start.checked property false , remains false. ui not show actual value. seemingly remains checked. have tried refresh() , update() on levels.

does have idea? possibly keep ui showing actual value?

i found similar problem, except datagridview. solution found invalidate control , request redrawn, follows:

public void resetbutton() {     checkbox_start.checked = false;     checkbox_start.invalidate();     checkbox_start.update(); } 

try that, see if fixes it.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -