如何在窗体内部拖动也可以随意拖动窗体?
Jieni 2004-08-30 02:03:53 由于设计需要,我把窗体的borderstyle属性设位bsnone,但又想随意拖动,因为没有了标题拦,所以我做了下面的函数,目的是让用户在窗体内拖动也如同拖动标题栏,但还是不行,请大侠指正!!
Procedure WMNCHitTest(Var M:TWNCHitTest);message WM_NCHitTest;
procedure TForm1.WMNCHitTest(Var M:TWNCHitTest)
begin
inherited;
if M.Result=htClient then M.Result:=htCaption;
end