打开窗体文件的源码,把两个控件声明的代码改为如下:object StringGrid1: TStringGrid Left = 16 Top = 40 Width = 337 Height = 257 TabOrder = 5 object ProgressBar1: TProgressBar Left = 72 Top = 170 Width = 150 Height = 17 Min = 0 Max = 100 TabOrder = 0 OnMouseDown = ProgressBar1MouseDown end end移动的代码如下procedure TFrm_Main.ProgressBar1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin inherited; Windows.ReleaseCapture; Windows.SendMessage(Self.ProgressBar1.Handle, WM_SYSCOMMAND, $F012, 0);end;