|
-
Jun 25th, 2002, 06:47 PM
#1
Thread Starter
Lively Member
-
Jun 25th, 2002, 09:44 PM
#2
Member
The easy way to keep count of how many buttons has been pressed is to use a text box or label. I'll assume the label is called count and I'll just use button1.
This code should be put into the buttons command:
count.caption = count.caption + 1
Just put that in for every button.
Why is it that when you kill one man people call you a murderer and when you kill one thousand you are a conqueror?
-
Jun 25th, 2002, 10:30 PM
#3
Thread Starter
Lively Member
thanx, that answered one of my questions
-
Jun 25th, 2002, 10:48 PM
#4
Member
Glad to be of asistance. I'm not 100% sure of how to get a random button selected, but it probably needs something like a control array.
110359
Why is it that when you kill one man people call you a murderer and when you kill one thousand you are a conqueror?
-
Jun 26th, 2002, 02:37 AM
#5
Thread Starter
Lively Member
well im not sure.
and when i thought about this game i thought it would be an easy one. lol
it was easier to make a mp3 player that doesnt s rely on the windowsmedia.ocx
-
Jun 28th, 2002, 03:10 AM
#6
New Member
to have that random stuff, cant you just give each button a number and then make the program make a random nunber and....yeah, see what i mean?
or give each row a number, each coloumn a number and do the same thing?
I have always wondered...what program did they use to make VB?
-
Jul 1st, 2002, 09:32 PM
#7
Junior Member
To keep track of how many clicks there are, you just need a variable. Let's suppose we call it n_Clicks. You'd do n_Clicks = n_Clicks + 1 every time a button is clicked.
As for a random button being selected... It would be much easier to create a control array. Just create a single button in the upper-left corner and call it, say, ClickButton. Give it the index '0'. Next, using for... to...'s, spawn all your buttons in your Form_Load. They'll all have a unique number. Create a variable to hold the current button being clicked (like, say, CurrentButton). When the user clicks it, do the following...
ClickButton(CurrentButton).value = vbunchecked
CurrentButton = int(rnd * (max amount of buttons))
ClickButton(CurrentButton).value = vbchecked
-
Jul 5th, 2002, 01:13 AM
#8
Addicted Member
TIPP:
Ok, as for the first question:
I wouldn't use a variable, for you'd need a global one (or a static one) which kinda sucks. I'd use a hidden TB.
For the second part I agree with Lancer, a ControlArray would be fine, and then just ControlArray.Add new OB's in a loop to build your form....
You can then ControlArray(rnd(1)*whatever)=true.
Hope this Helps,
CodeRonin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|