Hallo padavan,
ändere deinen Code mal so ab:
Delphi-Quellcode:
procedure TForm1.ListView1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
i: integer;
begin
if source is tfilelistbox then
titelwahl else
if source is tlabel then
titelwahl_label else
if source is tShellTreeView then
begin
if Form_listview2.FileListBox2.Count > 0 then
Form_Listview2.Titelwahltreeview;
end else
if source = Listview1 then
begin
if listview1.DropTarget.Index < Listview1.Items.Count then
begin
for i := 1 to Listview1.SelCount do
begin
listview1.items.Insert(Listview1.DropTarget.Index);
Listview1.Items[listview1.DropTarget.Index - 1] := listview1.Selected;
Listview1.Items[listview1.itemindex].free;
end;
end;
end else
if source = Form_listview2.ListView2 then
Form_Listview2.Titelwahl2 else
end;
Sollte das seltsame Verhalten durch einen wild pointer verursacht werden, dann könntest du das durch ein Umstellen deines Codes herausfinden:
Delphi-Quellcode:
procedure TForm1.ListView1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
i: integer;
begin
if source = Form_listview2.ListView2 then
Form_Listview2.Titelwahl2 else
if source is tfilelistbox then
titelwahl else
if source is tlabel then
titelwahl_label else
if source is tShellTreeView then
begin
if Form_listview2.FileListBox2.Count > 0 then
Form_Listview2.Titelwahltreeview;
end else
if source = Listview1 then
begin
if listview1.DropTarget.Index < Listview1.Items.Count then
begin
for i := 1 to Listview1.SelCount do
begin
listview1.items.Insert(Listview1.DropTarget.Index);
Listview1.Items[listview1.DropTarget.Index - 1] := listview1.Selected;
Listview1.Items[listview1.itemindex].free;
end;
end;
end else;
end;
marabu