aussie_guy_nik
asked on
Copy/Paste to Clipboard
I have a memo box and a few menu items such as Copy, Cut, Paste, etc.
I would like to know how to copy and paste these items to and from clipboard.
Actually I already got paste to work, but copying the selected text to clipboard, I can't get to work.
I would like to know how to copy and paste these items to and from clipboard.
Actually I already got paste to work, but copying the selected text to clipboard, I can't get to work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Take a look at sending the WM_CUT, WM_PASTE, WM_COPY messages to the control.
You can also try:
clipBoard.asText := memo1.selText;
or even:
var
str : pchar;
...
str := memo1.selText;
clipBoard.setTextBuf(str);
For assigning other sorts of data to the clipBoard you can try:
clipBoard.assign(image1.pi cture.bitm ap);
There are many ways to do this, I sugest checking out the help files might be a good idea.
GL
Mike
clipBoard.asText := memo1.selText;
or even:
var
str : pchar;
...
str := memo1.selText;
clipBoard.setTextBuf(str);
For assigning other sorts of data to the clipBoard you can try:
clipBoard.assign(image1.pi
There are many ways to do this, I sugest checking out the help files might be a good idea.
GL
Mike
ASKER
edey
clipboard is not reserved object. isn't there a reserved clipboard object in windows which can be accessed.
tclipboard has to be declared, and I don't know how that's supposed to work.
thanks
clipboard is not reserved object. isn't there a reserved clipboard object in windows which can be accessed.
tclipboard has to be declared, and I don't know how that's supposed to work.
thanks
TClipboard is globally declared in clipbrd.pas, so you just have to add clipbrd to your uses clause, you don't even have to instantiate it.
GL
Mike
GL
Mike
ASKER
actually, I figured it out. there seems to be a simpler way to do all this, which unfortunatelly was not provided in any of the answers, so i am deleting this question.
ASKER
the simple answer, which seems to work is
memSQL.CopyToClipboard
memSQL.PasteFromClipboard
memSQL.CopyToClipboard
memSQL.PasteFromClipboard
I told you to use CopyToClipboard in the first reply...but if you want to delete the question go ahead