Thanx Mike and the rest,
I had it except for the drop point! There I had drawn a blank, but
I've got it now.
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]
Don't know if D2005 dragging & dropping is any different to D7, but the code
below allows you to do what you want to do inside a listbox.
Mike
procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := Sender is TListBox;
end;
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
intCount: integer;
ptCord: TPoint;
strList: string;
begin
ptCord.x := x;
ptCord.y := y;
intCount := 0;
while intCount <= TListBox(Source).Items.Count-1 do
begin
if TListBox(Source).selected[intCount] then
begin
with Sender as TListBox do
begin
strList := TListBox(Source).Items[intCount];
TListBox(Source).Items.Delete(intCount);
Items.Insert(itemAtPos(ptCord, True), strList);
end;
end;
inc(intCount);
end;
end;
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi