Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

This problem seems so trivial, yet it is causing me a big headache. I have 4 checkboxes in my custom control, which I use to control which subsets to show on a graph. When any of these CheckBoxes' Checked property is changed, it fires an event handler.

The problem is that the checked state always returns true, or false, whatever the CheckBox's initial value is, no matter how many times the event is run or what the UI shows. Here is a sample line:

C++
int i = System::Convert::ToInt16(vccCheck->Checked);


Any help would be appreciated, thanks.
Posted
Updated 18-Aug-10 3:48am
v3
Comments
Richard MacCutchan 17-Aug-10 10:21am    
I'm not sure I understand your problem; this function returns TRUE if the box is checked and FALSE otherwise. The initial state of the checkbox is not relevant. I also do not see why you want to convert this to an integer, it's a boolean value so you just need to check for true or false.
SnowHow 17-Aug-10 11:19am    
If you not getting a different value when you check the box the problem is with your assignment to the variable Checked..

1 solution

Please take a look at this article.HTH
An OwnerDraw ComboBox with CheckBoxes in the Drop-Down[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900