怎样控制窗体不移动?(100分)

  • 主题发起人 主题发起人 pingzi
  • 开始时间 开始时间
就这样结束了么,遗憾。<br><br>其实控制窗口不用鼠标移动很简单,就是前面已经说过的,在NCHITTEST上想变法。<br>只要屏蔽掉htCaption,以及边界就可以达到你想要的效果,并且能够保证系统菜单,按钮继续工作。<br><br>&nbsp; TForm1 = class(TForm)<br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; &nbsp; procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;<br>&nbsp; public<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>{ TForm1 }<br><br>procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);<br>begin<br>&nbsp; inherited;<br>&nbsp; case Message.Result of<br>&nbsp; &nbsp; htCaption,<br>&nbsp; &nbsp; htBorder,<br>&nbsp; &nbsp; htTop,<br>&nbsp; &nbsp; htTopLeft,<br>&nbsp; &nbsp; htTopRight,<br>&nbsp; &nbsp; htLeft,<br>&nbsp; &nbsp; htRight,<br>&nbsp; &nbsp; htBottom,<br>&nbsp; &nbsp; htBottomLeft,<br>&nbsp; &nbsp; htBottomRight:<br>&nbsp; &nbsp; &nbsp; Message.Result := htNoWhere;<br>&nbsp; end;<br>end;<br>
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部