Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing duplicate entries
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00118204
Message ID:
00121845
Views:
15
>>
>Richard,
>
>You may find this behavior of toolbars useless, but if you were using a toolbar button for cut/copy/.and paste you would be really glad that the control doesn't give up focus. Toolbars and menus never get focus. I don''t why the coide I posted for you didn't work, it is all my toolbar methods. I never do anything in the button's click other than calling a method of the toolbar.
>
>The save button in the toolbars has this code;
>
>THIS.Parent.DoSave()
>
>The toolbar has this code in it;
>
>
>IF TYPE("oCreator.oForm.ActiveControl.Name") = "C"
>   IF PEMSTATUS(oCreator.oForm.ActiveControl,"Setfocus",5)
>      oCreator.oForm.ActiveControl.SetFocus()
>   ENDIF
>ENDIF
>oCreator.oForm.DoSave()
>
>
>oCreator is the app object which I store in a property of every form and toolbar.

I must be missing something. I put your code into the click event of a tool bar button and yes the focus goes back to the control on the form. Are you saying that the code in the valid method of the form's control should be called? It is not being called for me.

You said in your code comments "* Set focus to the same control to force the valid and lost focus to fire". How does setting the focus to same control we are already on cause the lostfocus and valid to occur?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform