Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid Event does not fire when I click outside of the ob
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00119392
Message ID:
00133808
Vues:
21
>Antonio,

>It all depends on where you click. Objects like menus and toolbars never getfocus, so teh contrl that had focus doesn't lose it. The Valid fires in the process of the control losing focus. You alos won't fire the valid if you click on the start bar and select a different applciation.

>For toolbars and enis in VFP you can address the issue by inlcuding the following lines of code in every method that may fire as a result of hitting a menu or toolbar button.


>IF TYPE(_SCREEN.ActiveForm.ActiveControl.Name) = "C"
IF PEMSTATUS(_SCREEN,ActiveForm.ActiveControl, "SetFocus",5)
_SCREEN.ActiveForm.ActiveControl.SEtFocus()
ENDIF
ENDIF
* The rest of the code here


>The code checks to be sure there is an activecontrol and then it checkls to be sure that control has a SetFocus method. It then calls teh setfocus fo teh current control. By setting focus to itself a control will fier its valid, LostFocus, When, and finally the GotFocus.

>JimB

i also have toolbars and menus. tried to implement the above code with my variations. i have one toplevelform (sdi) with a pageframe. i would like to put the code in the "save" button on the toolbar. tried doing this but either had trouble drilling down to the activecontrol, or there is no activecontrol while in the toolbar - i could not tell which. while in the code of the menu and toolbar can you reference the acivecontrol and activepage? getting a little confused.

also read somewhere today that clicking outside the grid would not cause the grid textbox valid event to fire properly. is this true? does not seem to be my experience. if it is true, what is the work around for this?

thanks - brenda
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform