check box trouble

rOSSybOY

Newcomer
Joined
Dec 2, 2005
Messages
6
i have 4 check boxes, a calculate button, and a label. when u check the box or boxes u want, u click the calc button, and it will at those prices to the base cost, and then it will show your total cost in a label. when i check mulitple boxes, it adds the lowest box's value -- example
Shoes $20
Hat $15
Shirt $14
say i click hat and shirt, it will only add the $14 that the shirt costs to the total cost.. i have tried many things but none seem to fix the problem :confused:
 
This is too simple....Techmanbd's right though, you should show some attempt to solving your problem. But this one is too simple.

In your Add button sub:
Visual Basic:
If ckShirt.Checked Then
'add shirt cost
ElseIf ckHat.Checked Then
'add hat cost
ElseIf ckShoes.Checked Then
'add shoes cost
End If
 
i think i have found the solution already, it was just a simple thing i was doing wrong, that i didnt see, but anyways, thanx for the input
 
DiverDan said:
In your Add button sub:
Visual Basic:
If ckShirt.Checked Then
'add shirt cost
ElseIf ckHat.Checked Then
'add hat cost
ElseIf ckShoes.Checked Then
'add shoes cost
End If
Don't wanna do that! That will add one and only one of the prices into the total (ElseIf chains will execute no more than one block of code: that for the first true condition it finds).
Visual Basic:
If ckShirt.Checked Then _
    'add shirt cost
If ckHat.Checked Then _
    'add hat cost
If ckShoes.Checked Then _
    'add shoes cost
 
Marble eater, you'd be better off re-reading the original post a couple of more times than posting ridiculous comments that are just plain wrong...again.

and then it will show your total cost in a label. when i check mulitple boxes, it adds the lowest box's value
 
Last edited:
My apologies. Excuse my plain wrongness, but I was under the ridiculous impression that (and still am not sure that I was wrong)...
and then it will show your total cost in a label. when i check mulitple boxes, it adds the lowest box's value
was a description of what was going wrong, as opposed to a desired result.

Well, if I was wrong, my apologies again (again?) for my complete and utter ridiculousness. In the future I hope to not displease you with my imperfections (or perceived imperfections, whichever is applicable) and plain wrongness (or so perceived wrongness, again (again?), whichever is applicable).

I appreciate the friendly manner in which you pointed out my alleged mistake. It's great to see you sharing constructive criticism, which demonstrates your good attitude and desire to improve and aid in the world of programming. The fact that you so strongly embrace the idea of the online community and the warm friendliness associated with community, shows a glimmer of hope in this dark, sad, lonely world. I hope that together we can eliminate ridiculousness and plain wrongness from everything .Net so that some day the world can again be a happy place with kittens and rainbows!

(What do you mean, again?)



In all seriousness, If I misunderstood you, rOSSybOY, I apologize. I hope I didn't provide you with any misinformation.
 
I would concur with marble_eater on this one, I thought that was part of the problem that rossyboy was trying to fix. I guess that rossyboy is the only one that knows either way for certain.

But either way comments like...

Marble eater, you'd be better off re-reading the original post a couple of more times than posting ridiculous comments that are just plain wrong...again.

aren't really necessary. As for marble_eaters reply I think you may have overloaded my sarcasm parser with that one. ;)
 
Back
Top