delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
移动窗体时,如何实时行到窗体的位置 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消息,但只是在移动结束后才行到,想在移动的过程中实时得到位置,应该用什么消息???

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);

posted on 2008-11-18 14:34 delphi2007 阅读(138) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。