Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

help me: i need to use multiple check boxes in vb6, but it needs to be like pizza toppings you can choose which one you should put ..

OpenStudy (anonymous):

in VB6 you're able to drag and drop components to GUI, in which part do you exactly need help.

OpenStudy (anonymous):

well, i need to create pizza toppings wherein in you can choose what you want to add on your pizza.

OpenStudy (anonymous):

ok create a new form (Standart EXE), drag and drop checkboxes and labels, modify them as required, this would only be the GUI, then you could start programming.

OpenStudy (anonymous):

can you please look at that rar file, you should be able to see my problem clearly from there the checkboxes that needs to be fix .. help me please

OpenStudy (anonymous):

I don't have vb6 on this computer but if you send me a screenshot, I'll have a look at it

OpenStudy (anonymous):

there :)) the toppings parts. i don't know how to add those like if i choose cheese and tomatoes .. then the total toppings i want should be 2 .. that's where i'm stuck

OpenStudy (anonymous):

ahh ok you should've said that before :D

OpenStudy (anonymous):

I'll lead you, try this. create an integer variable and everytime one of the checkboxes clicked add + 1 to that integer, and if the integer reacher 2, so if integer = 2 then msgbox you have reached the max toppings etc I hope it makes sense

OpenStudy (anonymous):

so you're basically setting up a condition for it.

OpenStudy (anonymous):

this would be more approprate way to do, when a topping is clicked(checked) add + 1 to integer, if the customer changes their minds and unchecks the topping then integer - 1, this way would be better

OpenStudy (anonymous):

figured that i need to do that but what should i use .. for loop .. if then statement? how will it add to the previous added or removed checked box..

OpenStudy (anonymous):

create a global integer, you do that by declaring it by the top, then double click on each checkbox and write the same code, which would be if integer = 2 then msgbox "max topping is 2" else if checkbox is checked then integer - 1 else if check is not checked then integer + 1 checkbox is checked end if

OpenStudy (anonymous):

whats the current status?

OpenStudy (anonymous):

still trying working on it .. ahaha

OpenStudy (anonymous):

have you done exactly what I have said above

OpenStudy (anonymous):

yup :)) thank you very much but what if the maximum is 10?

OpenStudy (anonymous):

then instead of checking for if integer = 2 you check for 10

OpenStudy (anonymous):

if integer = 10 then msgbox "max topping is 10" so you just replace 2 with 10. and you're done

OpenStudy (anonymous):

thank you very much ^_^ its done

OpenStudy (anonymous):

no problem, good luck with your project :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!