Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2003
    Location
    Ilkeston, Derbyshire
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Which control has focus (2000)

    I want to execute a piece of code on the OnTimer event but only if a certain control has the focus. How do I do this?

    TIA
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Which control has focus (2000)

    You can get the active control in code: Screen.ActiveControl

    If Screen.ActiveControl.Name = "MyControl" Then
    ...
    End If

  3. #3
    Star Lounger
    Join Date
    Mar 2003
    Location
    Ilkeston, Derbyshire
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Which control has focus (2000)

    Spot on.

    Many thanks, Hans

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •