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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Copy and Paste on EDIT BOX 1

Status
Not open for further replies.

DJIM

Programmer
May 30, 2001
5
ZA
Hi,

I have a situation where I handle the clipboard in a VB component. In Foxpro I have a EditBox with text on it that I want to copy from and paste to.

On COPY the text from the EditBox is read and passed to the VB component that places the text on the clipboard. It seems to be working fine but when you predefine a string variable with constant value it takes the whole statement i.e. : lcString = "TEST" and passes ALL of that to the VB component in stead of just the string bit. BUT when you select the THISFORM.edtplannotes.TEXT it works? Why?

On PASTE it retrieves the information FROM the clipboard via the VB component. On the line in Foxpro where I set my VB field equal to my EditBox TEXT it tells me the field is readonly BUT the READONLY = .F. And in some instances while I was playing around with the code in Foxpro, it worked but i just pasted a tiny square black block.

Can anyone please help me on this?...Thanks.

 
DJIM

_CLIPTEXT will allow you to read and write to the clipboard without needing your VB control.

Chris :)
 
Thanks Chris. None of our Foxpro Developers is familiar with the _CLIPTEXT. Does that happen with API calls or not?
 
DJIM

_CLIPTEXT = THISFORM.Text1.Value will copy the textbox value to the clipboard.

THISFORM.Text1.Value = _CLIPTEXT will paste the clipboard contents into the control.

HTH

Chris :)
 
Chris,

I tried it and it gets the right data back from the clipboard, but when displayed, it just shows me a black box or square. Any Ideas?

Derick :)
 
Derick

I can't reproduce your problem - I am also assuming that the clipboard contains unformatted ASCII text, and not RTF or any other format, which would cause a problem.

Perhaps you could start with a simple test form containing a textbox and two command buttons, one to send the text to the clipboard and the other to paste it back into the control, which is basically what I did.

Keep us posted.

Chris :)
 
Thanks...I will test and let you know. Its just funny that when you debug the program, the data is transferred correctly from the clipboard onto the field VALUE without being in the wrong format. Its just when it displays it that its in the wrong format. This change in format ONLY happens when you do a copy and paste. Reading from the database (SQL) and entering new data is readable.

But I will play around and let you guys know. Thanks for your help sofar.

Derick :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top