| oguzozturk74 | 13.03.2004 - 23:53:04 |
| 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; | |