>>I have an editbox in vfp3.0b and I want to able use a right-click popup with undo, cut, copy, paste, and select all. Every thing works fine except the copy. When I select text and then right-click in the box the rightclick activates the popup but deselects the the text.
>>
>>I would appreciate any suggestions.
>
>In the right click method of a textbox subclass:
>
>do mymenu.mpr with This
>
>The code generated by GenMenu produced the following code (after removing all the comments):
>
>LParameters loObject
>DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
>DEFINE BAR _med_cut OF shortcut PROMPT "Cu\
> KEY CTRL+X, "Ctrl+X" ;
> SKIP FOR loObject.SelLength = 0 ;
> MESSAGE "Removes the selection and places it onto the Clipboard"
>DEFINE BAR _med_copy OF shortcut PROMPT "\> KEY CTRL+C, "Ctrl+C" ;
> SKIP FOR loObject.SelLength = 0 ;
> MESSAGE "Copies the selection onto the Clipboard"
>DEFINE BAR _med_paste OF shortcut PROMPT "\> KEY CTRL+V, "Ctrl+V" ;
> SKIP FOR Len(_ClipText) = 0 ;
> MESSAGE "Pastes the contents of the Clipboard"
>ACTIVATE POPUP shortcut
>
>You can of course add more functionality to this menu. You can also include the call to this menu from editboxes and anything else where text can be cut, copied, pasted.
I tried your idea however when I right-click the text is deselected and loObject.SelLength is always equal to 0