|
-
May 8th, 2002, 04:45 PM
#1
Thread Starter
Junior Member
Autoclick
1) how do you get something to happen automatically after like 3 minutes ?
2) how do you get a button to be pressed automatically when you start a program ?
Thanks!!!
-
May 8th, 2002, 04:48 PM
#2
1. user a timer control to determine when 3 minutes has past (180000 milliseconds)
2. call the click event in form_activate or main
-
May 8th, 2002, 04:49 PM
#3
For #2, use the following code:
Code:
Private Sub Command1_Click()
MsgBox "You pressed the button"
End Sub
Private Sub Form_Load()
Command1 = True
End Sub
-
May 8th, 2002, 04:52 PM
#4
#1
VB Code:
Private Sub Form_Load()
Me.Show
Dim lStart As Long
lStart = Timer
'180 sec = 3 min
Do Until Timer >= lStart + 180: DoEvents: Loop
MsgBox "3 Min is up!"
End Sub
-
May 8th, 2002, 05:02 PM
#5
Thread Starter
Junior Member
ok thx but for the command what would it be frmmain.command1. ???
-
May 8th, 2002, 05:04 PM
#6
Thread Starter
Junior Member
nevermind of thx
-
May 8th, 2002, 05:11 PM
#7
Thread Starter
Junior Member
ok, neither of them worked
i just wanna do the one where a button it pressed once you start a program.
thx again
-
May 8th, 2002, 05:35 PM
#8
Use the code I gave you.
Code:
Private Sub Command1_Click()
MsgBox "You pressed the button"
End Sub
Private Sub Form_Load()
Command1 = True
End Sub
Just change Command1 to the name of your button.
-
May 8th, 2002, 05:37 PM
#9
Fanatic Member
VB Code:
Private Sub Form_Activate()
Command2_Click
End Sub
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
May 8th, 2002, 05:42 PM
#10
The problem with putting it in Activate(), though, is that it will be fired anytime the Form becomes the active form.
-
May 8th, 2002, 05:43 PM
#11
Fanatic Member
True, very true,
didn't even think of that 
VB Code:
Private Sub Form_Load()
Command2_Click
End Sub
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
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
|