?
Solved

Copy/Paste to Clipboard

Posted on 2001-08-16
8
Medium Priority
?
343 Views
Last Modified: 2010-04-06
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.

0
Comment
Question by:aussie_guy_nik
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 6

Accepted Solution

by:
MannSoft earned 200 total points
ID: 6393330
so long as text is selected, Memo1.CopyToClipboard should work.
0
 
LVL 1

Expert Comment

by:krainey
ID: 6393341
Take a look at sending the WM_CUT, WM_PASTE, WM_COPY  messages to the control.
0
 
LVL 6

Expert Comment

by:edey
ID: 6393910
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.picture.bitmap);

There are many ways to do this, I sugest checking out the help files might be a good idea.

GL
Mike
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:aussie_guy_nik
ID: 6395744
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
0
 
LVL 6

Expert Comment

by:edey
ID: 6395872
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
0
 

Author Comment

by:aussie_guy_nik
ID: 6399666
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.
0
 

Author Comment

by:aussie_guy_nik
ID: 6399668
the simple answer, which seems to work is

memSQL.CopyToClipboard

memSQL.PasteFromClipboard
0
 
LVL 6

Expert Comment

by:MannSoft
ID: 6399921
I told you to use CopyToClipboard in the first reply...but if you want to delete the question go ahead
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question