On GotFocus issue

PearlGI

Registered User.
Local time
Today, 15:05
Joined
Aug 30, 2001
Messages
125
Experiencing problems with the On GotFocus event.

I have a form with an event procedure assigned to the On GotFocus event of the form itself. However, when the form receives focus (after returning from another form) the event is not triggered!

Any ideas?
 
When the form opens it does not get the focus. What gets the focus is the control that has the tab index = 0 that gets the focus. You may need to change it to the OnLoad event or the Activate event. If niether of them fire your event then the next option is to set up a timer interval of say 100 and place the code in the timer event. Remember to set the timer interval back to 0 in the first line of the event code or it will repeat itself.

David
 
Thanks David

Does that then mean that the On GotFocus event of the form itself can never be triggered? A redundant event......
 
The form itself only receives focus if it contains no controls that can receive focus, or, if such controls exist, they are disabled so that they cannot receive focus. The Form_Activate event should do the trick.
 

Users who are viewing this thread

Back
Top Bottom