Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to execute menu commands from a form
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00140504
Message ID:
00140616
Views:
26
This sounds like an issue of focus. Since the button is the currently active control when you click it, there is nothing to cut. You must first setfocus() to the previous object, then paste. You can do this by adding an oLastObject property to the form to hold the object reference.

In the when of your button, set the reference using:
ThisForm.oLastObj = ThisForm.ActiveControl
In the click of the button:
ThisForm.oLastObj.SetFocus()
SYS(1500, '_MED_CUT', '_MEDIT')  && Paste menu item
And finally, in the QueryUnload (or other suitable method):
thisform.oLastObj = .NULL.
return .t.
>Hello,
>
>We are using VFP 5.0a. In our menu we have added the Cut, Copy and Paste bar#.
>Now we want to execute these commands in our toolbar. We added the following line to our CLICK() event from the CUT button:
>SYS(1500,"_MED_CUT","_MEDIT")
>Normally this should work but alas it doesn't.
>Could somebody tell us what we might be doing wrong?
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform