Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2001, 04:48 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default How to copy a complete stringlist to the clipboard?

Hi...
I need to copy the whole contents of a memo box to the clipboard and in case copy only the selected text...and I didn't find anything useful in the built in help...can anybody help me?
Thx...gLes
Reply With Quote
  #2  
Old 01-06-2001, 04:55 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default PS: Stringlists...

Can anybody help me to copy a TListView's item's captions to a stringlist....and then the stringlist to clipboard ofcourse
Thx again...gLes
Reply With Quote
  #3  
Old 01-06-2001, 07:13 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: PS: Stringlists...

This is an answer to the StringList

Uses clipbrd

procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
With ListBox1 do
begin
Clear;
for i := 0 to ListView1.Items.Count-1 do
begin
Items.Add(ListView1.Items[i].Caption);
Items.AddStrings(ListView1.Items.Item[i].SubItems);
end;
end;

Clipboard.AsText:= Listbox1.Items.Text;
end;
Reply With Quote
  #4  
Old 01-06-2001, 07:29 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: How to copy a complete stringlist to the clipboard?

Look at the following for functions that you can use:

RichEdit1.SelStart := 0;
RichEdit1.SelLength := Length(RichEdit1.Text);
RichEdit1.CopyToClipboard;
Edit1.PasteFromClipboard;

This would copy everything from a RichEdit to the clipboard and then paste it into the Edit1.Text property.
Reply With Quote
  #5  
Old 01-07-2001, 04:12 AM
TiTeaM TiTeaM is offline
Senior Member
 
Join Date: Jan 2001
Posts: 113
Default RE: RE: How to copy a complete ... (Even more simple)

with RichEdit do
begin
SelectAll;CopyToClipboard;
end;
Reply With Quote
  #6  
Old 01-08-2001, 07:51 AM
Lapince Lapince is offline
Senior Member
 
Join Date: Jan 2001
Posts: 163
Default RE: How to copy a complete stringlist to the clipboard?

Where do you want to paste your items ?? In Notepad, or in your application ? If you want to copy it between your applications, I've exactly what you want (I made it to copy my Items from one MDI window to antoher...)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:52 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.