我创建了一个timage对象,如何能实现对他进行拖拽阿?

解决方案 »

  1.   

    将image放在panel上面,在image的mousemove事件中写:
      ReleaseCapture;
      SendMessage(Panel1.Handle, WM_SYSCOMMAND,SC_MOVE+HTCAPTION, 0);
      

  2.   

    procedure TForm1.Edit1MouseDown(Sender: TObject; Button: TMouseButton;
    Shift: TShiftState; X, Y: Integer);
    const
       SC_DragMove = $F012; //$F020
    begin
       ReleaseCapture;
       (Sender as TWinControl).Perform(WM_SysCommand, SC_DragMove, 0);
    end;
    //移動Edit1的一個例子
      

  3.   

    回复人: yonny(会不会有一天把自己也做成EXE?)(答案:略) ( ) 信誉:105  2005-08-21 22:50:00  得分: 0  
    将image放在panel上面,在image的mousemove事件中写:
      ReleaseCapture;
      SendMessage(Panel1.Handle, WM_SYSCOMMAND,SC_MOVE+HTCAPTION, 0);
    上面这个错了。是mousedown,写快了。