Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy and Paste anyone?
Message
From
14/08/2000 09:57:30
 
 
To
14/08/2000 09:38:45
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00404483
Message ID:
00404495
Views:
12
>>Hi Guys
>>Any good ideas on how to copy from one editbox and paste into another.
>>Thanx-a-ton - John
>
>You can include the standard VFP Edit-Copy and Edit-Paste options on your menu, then you'll be able to copy/paste directly.
>OR
>If you want to program your own copy/paste, then look at the SelStart, SelLength and Seltext properties of the EditBox control.
>
>e.g. to copy selected text from editbox1 to editbox2
>
>IF THISFORM.edtBox1.SelLength > 0 &&don't really need this
>THISFORM.edtBox2.SelText = THISFORM.edtBox1.SelText
>ENDIF

If the menu option isn't suitable, I've simulated CTRL-C & V using ON KEY LABEL,
copying SelText for the control to the clipboard. e.g.

ON KEY LABEL CTRL+C CopyText()
ON KEY LABEL CTRL+V PasteText()

PROC CopyText
_CLIPTEXT = _SCREEN.ActiveForm.ActiveControl.SelText
ENDPROC

PROC PasteText
_SCREEN.ActiveForm.ActiveControl.SelText = _CLIPTEXT
ENDPROC

Note : it is wise to check that current active control does have SelText property.
Mike

"I can live with doubt and uncertainty and not knowing. I think it is much more interesting to live not knowing than to have answers that might be wrong." - Richard Feynman
Previous
Reply
Map
View

Click here to load this message in the networking platform