Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 델파이
- 편집기보다는 좋다
- 구형 노트북 IDE
- 파이썬
- QT GUI
- 여행
- 프로그래밍
- 멀티OS IDE
- 여러 OS지원
- 웹개발IDE
- 윈도우
- 40종 언어지원
- Pyside2
- 설악산
- 파이썬IDE
- 메보장보다 좋다
- 강릉
- 40종 언어 지원
- 자동완성만 써봐도 괜찮음
- 지니 ide
- 구형 개발용 컴퓨터에 딱이다
- 아직까지 공부중
- Python
- 편집기보다 좋다
- 큐비트럭
- 데비안
- geany ide
- 멀티OS
- 초경량 ide
- 편집기 같은 IDE
Archives
- Today
- Total
아브아카의 세상 빼꼼 바라보기
Delphi lisbox drag and drop 본문
var StartingPoint : TPoint; implementation ... procedure TForm1.FormCreate(Sender: TObject) ; begin ListBox1.DragMode := dmAutomatic; end;
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer); var ListBox: TListBox; i, TargetIndex: Integer; SelectedItems: TStringList; begin Assert(Source=Sender); ListBox := Sender as TListBox; TargetIndex := ListBox.ItemAtPos(Point(X, Y), False); if TargetIndex<>-1 then begin SelectedItems := TStringList.Create; try ListBox.Items.BeginUpdate; try for i := ListBox.Items.Count-1 downto 0 do begin if ListBox.Selected[i] then begin SelectedItems.AddObject(ListBox.Items[i], ListBox.Items.Objects[i]); ListBox.Items.Delete(i); if i<TargetIndex then dec(TargetIndex); end; end; for i := SelectedItems.Count-1 downto 0 do begin ListBox.Items.InsertObject(TargetIndex, SelectedItems[i], SelectedItems.Objects[i]); ListBox.Selected[TargetIndex] := True; inc(TargetIndex); end; finally ListBox.Items.EndUpdate; end; finally SelectedItems.Free; end; end; end;
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean) ; begin Accept := Source = ListBox1; end; procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer) ; begin StartingPoint.X := X; StartingPoint.Y := Y; end;
출처 : http://stackoverflow.com/questions/9176684/delphi-listbox-drag-drop-multiple-items
'컴퓨터 > Delphi 코딩' 카테고리의 다른 글
Delphi Lite (0) | 2018.04.17 |
---|---|
델파이 stringlist Natural Order 정렬하기 (0) | 2015.08.05 |