Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   General (http://www.delphipages.com/forum/forumdisplay.php?f=2)
-   -   How to copy a complete stringlist to the clipboard? (http://www.delphipages.com/forum/showthread.php?t=18136)

gLes 01-06-2001 04:48 PM

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:)

gLes 01-06-2001 04:55 PM

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:)

douglas 01-06-2001 07:13 PM

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;

douglas 01-06-2001 07:29 PM

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.

TiTeaM 01-07-2001 04:12 AM

RE: RE: How to copy a complete ... (Even more simple)
 
with RichEdit do
begin
SelectAll;CopyToClipboard;
end;

Lapince 01-08-2001 07:51 AM

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...)


All times are GMT. The time now is 05:29 AM.

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