Board index » cppbuilder » Run time checking a checkbox

Run time checking a checkbox

Hi all

I want to check a checkbox at runtime. The act of clicking on the checkbox
checks it. I don't want this. Instead I want the user to click on the check
box and invoke some code that checks it. Is this possible? If so how can I
do it?

TIA

Tim

 

Re:Run time checking a checkbox


My first question is why?  Why not just let VCL handle
checking/unchecking the control and write an event handler so that
you're notified?

Maybe you want to do some processing and determine if the control should
be checked?  If so, just do it in the event handler.  If you determine
it should not be checked then you can uncheck it by setting the
control's Checked property to false.

However, from a user interface standpoint, if the user cannot check it
they're going to get mighty frustrated.  It'd be better, IMHO, that at
the time whatever changes that causes you to disallow checking it, if
you set its Enabled property to false.  That way you wouldn't even get
check events, and the user would see a grayed-out check.

Other Threads