by NicholsSoftware (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 27th March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Finds out if your program has the focus by using an API.
If Focus Then
Me.Caption = "Got Focus"
Else
Me.Caption = "Lost Focus"
End If
End Sub
Function Focus() As Boolean
If GetFocus = 0 Then
Focus = False
Else
Focus = True
End If
End Function