Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i set a count for each checkbox and count the number of times it has been selected (eg) i have to create a PROGRAM that will enable user to vote for a candidate and it has to add a count to each candidate that has been selected please help me if U can
Posted
Comments
Simon Bang Terkildsen 18-Aug-11 13:28pm    
Choose either C# or VB.NET, while these two can be mixed it doesn't make sense here.
What exactly do you need help with?
if you want someone to tell you how to do it from A to Z then I think you're out of luck unless you bring out your wallet.
sparbery 18-Aug-11 14:49pm    
i can show u what i have done if u dont mind coz i did try but im failing to count multiple checks ?

I wouldn't do it that way. I would have a counter in a candidate object that gets updated when user clicks submit (adds one if his box is checked). But hey, that's just me.

I would also use radio buttons, but again, that's just me.
 
Share this answer
 
Comments
Simon_Whale 18-Aug-11 13:55pm    
Thats how I would of done it too, have the candidate hold the number of votes rather than the checkbox / radio button
Inherit a new control from the Checkbox. Add a property to count, then tick that count up every time the checkbox is selected.
 
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