Board index » cppbuilder » Question about checking a checkbox programatically

Question about checking a checkbox programatically


2006-09-20 01:47:20 AM
cppbuilder71
Hello,
I am wondering if there is a way to prevent the OnClick event from occuring on a checkbox when you check the checkbox programatically?
 
 

Re:Question about checking a checkbox programatically

"Alan" < XXXX@XXXXX.COM >wrote in message
Quote
I am wondering if there is a way to prevent the OnClick event
from occuring on a checkbox when you check the checkbox
programatically?
There are three ways:
1) derive a new component from TCheckBox, promote the protected
ClicksDisabled property to public, then you can set it to true before
checking the box, and then set it back to false aferwards.
2) using a normal TCheckBox, set your own flag somewhere that the OnClick
event handler can look at and exit immediately when needed. Then set the
flag before checking the box, and set it back to false afterwards
3) assign NULL to the OnClick event before checking the box, and then
restore the old event handler afterwards
Gambit