Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

  • *Experts*
Posted

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:

If ckShirt.Checked Then
'add shirt cost
ElseIf ckHat.Checked Then
'add hat cost
ElseIf ckShoes.Checked Then
'add shoes cost
End If

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • Leaders
Posted

In your Add button sub:

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).

If ckShirt.Checked Then _
   'add shirt cost
If ckHat.Checked Then _
   'add hat cost
If ckShoes.Checked Then _
   'add shoes cost

[sIGPIC]e[/sIGPIC]
  • *Experts*
Posted (edited)

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
Edited by DiverDan

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • Leaders
Posted

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[/Quote]

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.

[sIGPIC]e[/sIGPIC]
Posted

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. ;)

Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...