移动窗体时,如何实时行到窗体的位置
移动窗体时,如何实时行到窗体的位置 VCL组件开发及应用
http://www.delphi2007.net/DelphiVCL/html/delphi_20061224150251152.html
procedure Tfrm_Design.WMNCHitTest(var Msg: TMessage);
begin
Caption:=IntToStr(Self.Left);
inherited;
end;
获得了WM_NCHITTEST消息,但只是在移动结束后才行到,想在移动的过程中实时得到位置,应该用什么消息???
http://www.delphi2007.net/DelphiVCL/html/delphi_20061224150251152.html
procedure Tfrm_Design.WMNCHitTest(var Msg: TMessage);
begin
Caption:=IntToStr(Self.Left);
inherited;
end;
获得了WM_NCHITTEST消息,但只是在移动结束后才行到,想在移动的过程中实时得到位置,应该用什么消息???
procedure OnMoving(var Msg: TWMMoving); message WM_MOVING;
..........
procedure TFormDemo.OnMoving(var Msg: TWMMoving);
begin
Caption := IntToStr(msg.lpRect^.Left);
inherited;
end;
更详细的内容(上下左右)
Caption := IntToStr(msg.lpRect^.Left)+':'+
IntToStr(msg.lpRect^.Top)+':'+
IntToStr(msg.lpRect^.Right)+':'+
IntToStr(msg.lpRect^.Bottom);