How to trigger the CheckBox1_CheckedChanged event by change the checked value by code?

D

David

Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
N

news.microsoft.com

You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
D

David

Thanks,
but I don't think you understood my question. I want trigger the event when I change the value by code not user click operation.
Sure I have set autopostback to true, other the event would not fire even I use the mouse to click the checkbox.

David
You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
N

news.microsoft.com

I think what you can do is write a new function and move the code in CheckedChanged event into the new function.
Call this function when you change the value of the checkbox and in CheckedChanged event.

Thanks,
but I don't think you understood my question. I want trigger the event when I change the value by code not user click operation.
Sure I have set autopostback to true, other the event would not fire even I use the mouse to click the checkbox.

David
You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top