H huifi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-06 #1 Form的BorderStyle设为bsNone 在其上放有一Panel,Align设为alClient,窗体的大小怎样改变?
W wwolf Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-06 #2 private procedure WmNcHitTest (var Msg: TWmNcHitTest); message wm_NcHitTest; procedure TForm1.WmNcHitTest(var Msg: TWmNcHitTest); var Pt: TPoint; begin Pt := Point (Msg.XPos, Msg.YPos); Pt := ScreenToClient (Pt); if (Pt.x < 5) and (pt.y < 5) then Msg.Result := htTopLeft else if (Pt.x > Width - 5) and (pt.y < 5) then Msg.Result := htTopRight else if (Pt.x > Width - 5) and (pt.y > Height - 5) then Msg.Result := htBottomRight else if (Pt.x < 5) and (pt.y > Height - 5) then Msg.Result := htBottomLeft else if (Pt.x < 5) then Msg.Result := htLeft else if (pt.y < 5) then Msg.Result := htTop else if (Pt.x > Width - 5) then Msg.Result := htRight else if (pt.y > Height - 5) then Msg.Result := htBottom else inherited; end;
private procedure WmNcHitTest (var Msg: TWmNcHitTest); message wm_NcHitTest; procedure TForm1.WmNcHitTest(var Msg: TWmNcHitTest); var Pt: TPoint; begin Pt := Point (Msg.XPos, Msg.YPos); Pt := ScreenToClient (Pt); if (Pt.x < 5) and (pt.y < 5) then Msg.Result := htTopLeft else if (Pt.x > Width - 5) and (pt.y < 5) then Msg.Result := htTopRight else if (Pt.x > Width - 5) and (pt.y > Height - 5) then Msg.Result := htBottomRight else if (Pt.x < 5) and (pt.y > Height - 5) then Msg.Result := htBottomLeft else if (Pt.x < 5) then Msg.Result := htLeft else if (pt.y < 5) then Msg.Result := htTop else if (Pt.x > Width - 5) then Msg.Result := htRight else if (pt.y > Height - 5) then Msg.Result := htBottom else inherited; end;
Q QuickSilver Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-06 #3 虽然在Delphi中把窗口的属性BorderStyle设为bsNone可以让标题栏消失,但同时窗口却不能 缩放了,下面这段代码可以使你鱼和熊掌兼得,BorderStyle设为BsSizeable。 procedure TForm1.FormCreate(Sender:TObject); begin SetWindowLong(Handle,GWL_STYLE,GetWindowLong (Handle,GWL_STYLE) AND NOT WS_CAPTION); ClientHeight:=Height; end;
虽然在Delphi中把窗口的属性BorderStyle设为bsNone可以让标题栏消失,但同时窗口却不能 缩放了,下面这段代码可以使你鱼和熊掌兼得,BorderStyle设为BsSizeable。 procedure TForm1.FormCreate(Sender:TObject); begin SetWindowLong(Handle,GWL_STYLE,GetWindowLong (Handle,GWL_STYLE) AND NOT WS_CAPTION); ClientHeight:=Height; end;
S shenloqi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-06 #4 还有的方法就是继承CreateParam过程,设置Style以及StyleEx。
H huifi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-06 #6 to wwolf: 当在其上放有一Panel,Align设为alClient时WmNcHitTest过程将不发生,即接收不到 鼠标消息,不知有什么函数或方法将其上的Panel的所有鼠标消息转发到Form上?
to wwolf: 当在其上放有一Panel,Align设为alClient时WmNcHitTest过程将不发生,即接收不到 鼠标消息,不知有什么函数或方法将其上的Panel的所有鼠标消息转发到Form上?