Event when form loses focus?
Posted on 2004-09-01
I'd like my app to copy some specific data to the clipboard as soon as its form loses focus (when it's minimized, or when the user switches to another window).
I thought I could simply use the .LostFocus event for the form. I'm simply doing this:
Private Sub Form_LostFocus()
[code to copy data to clipboard]
...but it doesn't seem to have any effect. Maybe I'm using it wrong?
I know could keep a timer running to periodically check if the app still had the focus, but that seems kludgy. Isn't there a smoother way? Thanks!