Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   pasar ListView al Clipboard (https://www.clubdelphi.com/foros/showthread.php?t=5747)

allende 02-12-2003 23:50:57

pasar ListView al Clipboard
 
Hola amigos, alguien sabe como pasar el contenido de un ListView al ClipBoard?

gracias

__cadetill 03-12-2003 10:55:24

esto es para pasar un DBGrid al Portapapeles. Supongo que adaptandolo un poco no te costará mucho

Código:

const TAB = #9;
var i      : Integer;
    List    : TStrings;
    StrList : String;
begin
    //*************
    // ********* AÑADE ClipBrd EN EL USES DEL FORM
    //*************

    List := TStringList.Create;

    try
        StrList := '';
        for i := 0 to Pred(RxDBGrid1.FieldCount) Do
            StrList := StrList + RxDBGrid1.Columns[i].Title.Caption + TAB;

        List.Add(StrList);

        Screen.Cursor := crHourGlass;
        while not RxDBGrid1.DataSource.DataSet.Eof do
        begin
              StrList := '';
              for i := 0 to Pred(RxDBGrid1.FieldCount) do
                StrList := StrList + RxDBGrid1.Fields[i].AsString + TAB;

              List.Add(strList);

              RxDBGrid1.DataSource.DataSet.Next;
        end;

        Clipboard.AsText := List.Text;
    finally
            Screen.Cursor := crDefault;
            FreeAndNil(List);
    end;
end;


allende 03-12-2003 19:31:36

gracias

muchas gracias amigo, con esa idea lo implemente para el listview y ya lo tengo funcionando


La franja horaria es GMT +2. Ahora son las 04:27:58.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi