Вниз
Скачать: 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.965 c
1-1084169503
booby2004
2004-05-10 10:11
2004.05.23
различные exe после компиляции одного и того же проекта


3-1082983490
Stupid
2004-04-26 16:44
2004.05.23
Как получить текст сообщения об ошибке при Query.ExecSQL?


1-1084287795
Гямук
2004-05-11 19:03
2004.05.23
Как убрать форму, но при этом оставить события...


3-1082982964
avgur
2004-04-26 16:36
2004.05.23
вопрос доступа к данным в сети


4-1081443763
Adil
2004-04-08 21:02
2004.05.23
System tray with tooltip and popup menu




   Наверх