I am making an quiz program. And I am finding it hard to get a label to add on numbers to it. So when they get a question right it will add points on the score. Please help
thanx
Michael Baynham 15
Printable View
I am making an quiz program. And I am finding it hard to get a label to add on numbers to it. So when they get a question right it will add points on the score. Please help
thanx
Michael Baynham 15
label1.caption = cint(label1.caption) + 1
or however many points you want to add. Or if the points are really hig use Clng(label1.caption)
------------------
-------------------------
I'm really easy to get along with once you people learn to
worship me.
-------------------------
Try this:
Code:Label1.Caption = Val(Label1.Caption) + NewPoints
------------------
Boothman
Quote:
There is a war out there, and it is about who controls the information, it's all about the information.
This would also work
Dim score as integer
score = score + 1
label1.caption = score
------------------
Sincerely,
Chris
:-) ;-)
Email [email protected]Quote:
just have fun out there and live life to the fullest while it is still here
If you wanted the score to update every time the user pressed the OK button, or whichever button you wanted them to press to answer a question, type this code:
sub command1.click() (or whaterver it happens to be)
score = score + 1 (or hwever many points you add per correct question)
label1.caption = score
If you are using more than one form for your quiz program and you want to be able to access it from every form thne first put this in a module...
public score as integer
-Edward Hinchliffe