| View previous topic :: View next topic |
| Author |
Message |
choco-late Newbie
Joined: 18 Aug 2005 Posts: 12
|
Posted: Aug 23rd, 2005 04:54 AM Post subject: |
|
|
thank you again !
i think this is my last question, well after all the dice are gone and i click on the roll dice button the score keeps on adding?
Can i do something like the button not in use after all dice are gone?
if its that how can i do it? or is there some other way? |
|
| Back to top |
|
choco-late Newbie
Joined: 18 Aug 2005 Posts: 12
|
Posted: Aug 23rd, 2005 06:28 AM Post subject: |
|
|
| dougthomas wrote: | Hi,
To keep the score adding up just define intTotal as Public in the Declarations section of the project and only set it to zero at the very beginning of each game.(not each throw)
|
Is this the code for it ? | Code: | | Public intTotal As Integer |
Right now i just need to know where should i put this code ??
I tried at the start of my coding but it doesnt work ....
Do i put it in a separat module ?? or something like esle ? |
|
| Back to top |
|
DoobieKeebler Moderator

Joined: 17 Jun 2005 Posts: 254 Location: 181°15'2.003"W, 93°5'16.956"N
|
Posted: Aug 23rd, 2005 08:27 AM Post subject: |
|
|
Your "Public intTotal As Integer" line is correct. Put that code right at the top of the form's code, outside of and before any subs or functions. (If you are using Option Explicit then it should go right after that.)
The Enabled property of a command button determines whether or not it can be clicked. If all 5 of the image boxes have their Visible property set to true then set the command button's Enabled property to False (e.g. Command1.Enabled = False).
Off topic: I usually take weekends off. I find I'm much less likely to end up as the top story on the evening news that way. =D Just so nobody thinks I don't care or haven't bothered to reply.
Slightly off topic: choco-late, watch your If statements when you're making more than one comparison. In English we use "if this is that or those" as shorthand for "if this is that or this is those". In VB (and all other programming languages that I have seen code for) you need to explicitly say "If (this = that) Or (this = those)". It may help to use parentheses. Hopefully it will look wrong somehow to say "If (x = 5) Or (6)" and it will become automatic to write it the "correct" way. |
|
| Back to top |
|
choco-late Newbie
Joined: 18 Aug 2005 Posts: 12
|
Posted: Aug 24th, 2005 05:10 AM Post subject: |
|
|
| thank you for your advice ! ! and also thanx for your help ... |
|
| Back to top |
|
book621 Newbie
Joined: 11 Nov 2005 Posts: 6
|
Posted: Nov 11th, 2005 08:10 PM Post subject: You sure |
|
|
| Quote: | | OK, i am a beginner with vb and need to do an assignment for a dice game. right now i have no idea of how to code this. |
Are you sure about that because i dont think so. _________________ [new user link] [new user link] |
|
| Back to top |
|
|