On GotFocus issue (1 Viewer)

PearlGI

Registered User.
Local time
Today, 04:21
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?
 

DCrake

Remembered
Local time
Today, 04:21
Joined
Jun 8, 2005
Messages
8,626
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
 

PearlGI

Registered User.
Local time
Today, 04:21
Joined
Aug 30, 2001
Messages
125
Thanks David

Does that then mean that the On GotFocus event of the form itself can never be triggered? A redundant event......
 

missinglinq

AWF VIP
Local time
Yesterday, 23:21
Joined
Jun 20, 2003
Messages
6,420
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

Top Bottom