Results 1 to 11 of 11

Thread: Autoclick

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    25

    Question 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!!!

  2. #2
    mcsd2002
    Guest
    1. user a timer control to determine when 3 minutes has past (180000 milliseconds)

    2. call the click event in form_activate or main

  3. #3
    Megatron
    Guest
    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

  4. #4
    Megatron
    Guest
    #1
    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.     Me.Show
    4.    
    5.     Dim lStart As Long
    6.    
    7.     lStart = Timer
    8.     '180 sec = 3 min
    9.     Do Until Timer >= lStart + 180: DoEvents: Loop
    10.     MsgBox "3 Min is up!"
    11.    
    12. End Sub

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    25
    ok thx but for the command what would it be frmmain.command1. ???

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    25
    nevermind of thx

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Posts
    25
    ok, neither of them worked

    i just wanna do the one where a button it pressed once you start a program.


    thx again

  8. #8
    Megatron
    Guest
    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.

  9. #9
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    VB Code:
    1. Private Sub Form_Activate()
    2.  Command2_Click
    3. 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

  10. #10
    Megatron
    Guest
    The problem with putting it in Activate(), though, is that it will be fired anytime the Form becomes the active form.

  11. #11
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    True, very true,

    didn't even think of that

    VB Code:
    1. Private Sub Form_Load()
    2.  Command2_Click
    3. 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
  •  



Click Here to Expand Forum to Full Width