Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Key Label 4

Status
Not open for further replies.

fxsage

Programmer
Joined
Sep 9, 2002
Messages
21
Location
US
How can I assign the Cntr-v (paste) action to a command button, so that a click on the button pastes text?

Thanks
 
In the Click event:

KEYBOARD '{CTRL+v}'

Jim
 
Note that KEYBOARD '{CTRL+v}' will work if that functionality has been defined in a menu or toolbar or whatever.
You may need to use something like the following in the click event instead:

Code:
ThisForm.Text1.Value = _CLIPTEXT
-or-
ThisForm.Edit1.Value = ALLTRIM(ThisForm.Edit1.Value) + _CLIPTEXT



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
And yet another way:

SYS(1500, '_MED_PASTE', '_MEDIT')

Again, this assumes that you have a menu active (not necessarily visible) that includes the Paste command).

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Jim's example is the way to go in your particular situation.

In the future if you need to assign key strokes to a form, you will probably have better luck using the keypress event:

faq184-4097 KEYPRESS Event instead of ON KEY LABEL

Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top