This is untested. procedure TMyList.MyListDragDrop(Sender, Source: TObject; X, Y: Integer); var NewPos, OldPos: SmallInt; Z: TPoint; begin Z.X := X; Z.Y := Y; NewPos := RotationList.ItemAtPos(Z,False); OldPos := RotationList.ItemIndex; if NewPos < OldPos then Inc(OldPos); RotationList.Items.Insert(NewPos,RotationList[OldPos]); RotationList.Items.Delete(OldPos); end;
Regards, Ross. ----- Original Message ----- From: "Robert Meek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 21, 2005 2:50 AM Subject: Dragging items inside a Listbox D2005 Morning all, Does anyone have a code snip I can look at that provides the ability to change the order of listbox items via dragging them inside the listbox to their new position? All I've been able to find on Google are dragging to separate listboxes. Thanx in advance! from: Robert Meek at: [EMAIL PROTECTED] dba "Tangentals Design" home of "PoBoy" freeware Windows apps and utilities located at: www.TangentalsDesign.com e-mail to: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] _______________________________________________ Delphi mailing list -> [EMAIL PROTECTED] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [EMAIL PROTECTED] http://www.elists.org/mailman/listinfo/delphi

