ListBox un DragMode özelliği dmAutomatic yapılır, ve OnDragDrop , OnDragOver olayları kullanılır.
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := (Sender = Source);
end;
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
DropIndex: Integer;
begin
DropIndex := ListBox1.ItemAtPos(Point(X, Y), True);
ListBox1.Items.Exchange(ListBox1.ItemIndex, DropIndex);
end;
ListBox elemanlarını kendi içinde sürüklemek
-
- Kıdemli Üye
- Mesajlar: 574
- Kayıt: 01 Şub 2004 12:29
- Konum: Erdemli - MERSİN