Czesc
Nie wiem czy o coś takiego ci chodziło ale inaczej nie potrafie
tutaj przenosi z ListView do Memo, tylko ze w Memo musisz mieć ustawioną czcionke na Courier, Terminal lub inna o jednakowej szerokosci znaku.
procedure TForm1.Button1Click(Sender: TObject);
var MyFlexibleArray: array of integer;
temp,temp2: string;
x,w,a,c,h: integer;
begin
a:= ListView1.Columns.Count;
setlength(MyFlexibleArray ,a);//ustawienie tablicy dyna.. na liczbę kolumn
for x:=0 to a-1 do
begin
MyFlexibleArray[x]:=0;
end;
//tutaj znajduje najszerszy wpis w itemach i subitemach
for x:=0 to ListView1.Items.Count-1 do
begin
w:=length(ListView1.Items[x].Caption);
if MyFlexibleArray[0]<w then MyFlexibleArray[0]:=w;
for c:=1 to ListView1.Items[x].SubItems.Count do
begin
w:=length(ListView1.Items[x].SubItems.Strings[c-1]);
if MyFlexibleArray[c]<w then MyFlexibleArray[c] :=w;
end;
end;
//tutaj sie zaczyna dla itemow
for x:=0 to ListView1.Items.Count-1 do
begin
w:=length(ListView1.Items[x].Caption);
if MyFlexibleArray[0]>w then
begin
temp:=ListView1.Items[x].Caption;
for h:=0 to MyFlexibleArray[0]-w do
begin
temp:=temp+' ';
end;
temp:=temp+'|';
end
else temp:=ListView1.Items[x].Caption+' |';
//tutaj ida subitemy
for c:=1 to ListView1.Items[x].SubItems.Count do
begin
w:=length(ListView1.Items[x].SubItems.Strings[c-1]);
if MyFlexibleArray[c]>w then
begin
temp2:=ListView1.Items[x].SubItems.Strings[c-1];
for h:=0 to MyFlexibleArray[c]-w do
begin
temp2:=temp2+' ';
end;
temp:=temp+temp2+'|';
end
else temp:=temp+ListView1.Items[x].SubItems.Strings[c-1]+' |';
end;
Memo1.Lines.Add(temp);
end;//a tutaj konczy
end;
wymaga to pewnych poprawek, ale może ci się przyda
love