在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.在delphi中新建窗体程序,然后设置窗口的 BorderStyle属性为bsNone 2.在窗体的public区写下这一句: Procedure CreateParams(var Params :TCreateParams);override;
3.然后把光标停在这一行上,按下Ctrl+Shift+C,在出现的代码块里写上 inherited CreateParams(Params); if BorderStyle = bsNone then with Params do Style := Style or WS_THICKFRAME; Delphi中函数的覆盖记得在函数声明后面要加上关键字override; 完整代码: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } (*在public中加上这句*) Procedure CreateParams(var Params :TCreateParams);override; end; var Form1: TForm1; implementation {$R *.dfm} { TForm1 } {*当窗口是无边框无标题的时候 显示边框 让窗体可拉伸*} procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited; inherited CreateParams(Params); if BorderStyle = bsNone then with Params do Style := Style or WS_THICKFRAME; end; end.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论