procedure TForm2.ListBox1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin releaseCapture; ListBox1.Perform(WM_SYSCOMMAND,SC_MOVE+1,0); end;
VCL可视控件的鼠标拖动移动
MyGrid.OnMouseDown:= MouseDown; end; procedure TForm1.MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin releaseCapture; (sender as tstringgrid).Perform(WM_SYSCOMMAND,SC_MOVE+1,0); end;