Вниз
Скачать: 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.025 c
6-1080901826
Delpher_Gray
2004-04-02 14:30
2004.05.23
Неправельный приём/передача данных


3-1082502716
maniac
2004-04-21 03:11
2004.05.23
MySQL+Zeos Query делаю insert данные в базе а программе ошибка :(


1-1083959896
Sergix
2004-05-07 23:58
2004.05.23
Как скопировать каталог


3-1082534285
Felan
2004-04-21 11:58
2004.05.23
Master-Detail многие ко многим?


3-1083242358
Леван
2004-04-29 16:39
2004.05.23
СКОЛЬКО ЗАПИСЕЙ БЫЛИ ОБРАБОТАНЫ?




   Наверх