|
-
June 29th, 2001, 08:30 AM
#1
How can I make a button click twice...
Hi,
I have a button, but for what I want it to do, I need to click it twice to reset the situation in my game.
The code at the moment is :
Man1.Picture = Man2.Picture
Timer3.Enabled = Not Timer3.Enabled
Then Timer3 is :
Time2.Enabled = False
Instead of clicking this button TWICE, Is there a way to make the buton click twice when you click it once (i.e. a command, or something).
-
June 29th, 2001, 08:37 AM
#2
Re: How can I make a button click twice...
private sub command1_click()
static intX as integer
'your normal code
intX = intX +1
if intX < 2 then
call command1_click()
'before executing next line of code, it will do the second call
'to itself
intX = 0
end if
end sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
June 29th, 2001, 08:50 AM
#3
Re: However...
You'd better write your code to avoid "double clicking" of a command button:
you can put your code in a sub, and call it twice from command button click:
private Mysub()
'your code
End Sub
private sub command1_click()
'do it twice:
call Mysub
call Mysub
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|