Solved

Copy/Paste to Clipboard

Posted on 2001-08-16
8
329 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 50 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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