Вниз
Скачать: CL | DM;

Компонент ListView   Найти похожие ветки 

 
Box ©   (2004-05-09 02:35) [0]

Подскажите пожалуйста как сделать что бы по ListView можно было перемещать (Drag&Drop) несколько выделенных иконок, а то у меня только одна перемещается (остальные на месте остаются)???


 
Gero ©   (2004-05-09 08:03) [1]

{ ListView1.DragMode := dmAutomatic }

procedure TForm1.ListView1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
 DragItem, DropItem, CurrentItem, NextItem: TListItem;
begin
 if Sender = Source then
   with TListView(Sender) do
   begin
     DropItem    := GetItemAt(X, Y);
     CurrentItem := Selected;
     while CurrentItem <> nil do
     begin
       NextItem := GetNextItem(CurrentItem, SdAll, [IsSelected]);
       if DropItem = nil then DragItem := Items.Add
       else
         DragItem := Items.Insert(DropItem.Index);
       DragItem.Assign(CurrentItem);
       CurrentItem.Free;
       CurrentItem := NextItem;
     end;
   end;
end;

procedure TForm1.ListView1DragOver(Sender, Source: TObject; X, Y: Integer;
 State: TDragState;
 var Accept: Boolean);
begin
 Accept := Sender = Source;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.036 c
1-1083908296
Sla
2004-05-07 09:38
2004.05.23
Режим доступа к ТЕКСТОВОМУ файлу


1-1084188032
Никита
2004-05-10 15:20
2004.05.23
Конвертитрование HTML в RTF


1-1083571381
lehich
2004-05-03 12:03
2004.05.23
перемещение по строкам excel


6-1080549216
Creator
2004-03-29 12:33
2004.05.23
Client и Server Socket


1-1084103079
Islander
2004-05-09 15:44
2004.05.23
Мигание формы при изменении Position




   Наверх