Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.05.23;
Скачать: 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 вся ветка

Текущий архив: 2004.05.23;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.067 c
3-1082626061
Eleonora
2004-04-22 13:27
2004.05.23
Interbase, Query, DBMemo


14-1083325598
WondeRu
2004-04-30 15:46
2004.05.23
Глупый вопрос, но....


6-1080724295
Hooch
2004-03-31 13:11
2004.05.23
Simple MAPI, имена аттачментов


1-1084192563
Vitalnet
2004-05-10 16:36
2004.05.23
Скажите как правильно работать с TreeViewer


3-1083086961
как сделать
2004-04-27 21:29
2004.05.23
хочу объединить три поля одной таблицы в одно