当控件A被拖动到控件B的上方而没有放下时,触发控件B的OnDragOver事件

解决方案 »

  1.   

    listbox1DragDrop就是当listbox里面的内容被选择时,且鼠标拖动时产生的事件。而listbox1DragOver就是鼠标停留在所选内容上时产生的事件。
      

  2.   

    intotherain好像是玩星际的,怎么韩国经济萧条,改行玩DELPHI了?
      

  3.   

    麻烦各位随便解释一下:
    procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    var idx:Integer;
    begin
      if (Source = ListBox2) then
        Accept := True
      else if (Source = ListBox1) then
           begin
             idx:=ListBox1.ItemAtPos(Point(X, Y), True);
             if idx<>DragItem then Accept := False;
           end;
    end;
      

  4.   

    ListBox1DragDrop是有控件拖动到ListBox1上并松开鼠标时产生的,
    ListBox1DragOver是有控件拖动到ListBox1上时产生的。
      

  5.   

    有控件拖动到ListBox1上并松开鼠标------> ListBoxDragDrop,
    有控件拖动到ListBox1上---------------->ListBoxDragOver 
      

  6.   

    我基本上知道了,现在给分。可能就是把listbox1的数据拖到listbox2上!