怎么让 bsNone的form能Sizeable呢? 急,在线等啊,大侠指教~~~ 怎么让 bsNone的form能Sizeable呢? 急,在线等啊,大侠指教~~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Resize;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure FormResize(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } lpRect:TRect; mess1:string; procedure hitit(var msg:TWMNCHITTEST); message WM_NCHITTEST; public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.hitit(var msg: TWMNCHITTEST);var pt:TPoint;begin pt.x:=msg.XPos; pt.y:=msg.YPos; pt:=ScreenToClient(pt);if ptInRect(Rect(lpRect.Right-5,lpRect.Top+5, lpRect.Right+5,lpRect.Bottom-5),pt) then msg.Result:=HTRIGHT;//右边if ptInRect(Rect(lpRect.Left-5,lpRect.Top+5, lpRect.Left+5,lpRect.Bottom-5),pt) then msg.Result:=HTLEFT; //左边if ptInRect(Rect(lpRect.Left+5,lpRect.Top-5, lpRect.Right-5,lpRect.Top+5),pt) then msg.Result:=HTTOP; //上边if ptInRect(Rect(lpRect.Left+5,lpRect.Bottom-5, lpRect.Right-5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOM; //下边if ptinRect(Rect(lpRect.Left-5,lpRect.Top-5, lpRect.Left+5,lpRect.Top+5),pt) then msg.Result:=HTTOPLEFT;//左上角if ptInRect(Rect(lpRect.Right-5,lpRect.Bottom-5, lpRect.Right+5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOMRIGHT;//右下角if ptInRect(Rect(lpRect.Left-5,lpRect.Bottom-5, lpRect.Left+5,lpRect.Bottom+5),pt) then msg.Result:=HTBOTTOMLEFT; //左下角if ptInRect(Rect(lpRect.Right-5,lpRect.Left-5, lpRect.Right+5,lpRect.Left+5),pt) then msg.Result:=HTTOPRIGHT; //右上角end;procedure TForm1.FormCreate(Sender: TObject);begin lpRect:=ClientRect;end;procedure TForm1.FormResize(Sender: TObject);begin lpRect:=ClientRect;end;procedure TForm1.Button1Click(Sender: TObject);begin close;end;end. on sentence:setwindowlong(handle,GWL_STYLE, getwindowlong(handle,GWL_STYLE) and (not WS_CAPTION)); To wfhlxl() : 大侠,你的代码没用哦,你试试啊,把form的BordStyle设成bsNone,然后用你的代码,启动后不能sizeable的,~~~ 除非你不设成bsNone,可是我的窗体必须要是bsNone的,否则会很难看的。 fei19790920(饭桶的马甲(抵制日货)) 的代码可以用,谢谢。还有其他的答案嘛? 中午午饭前揭帖。谢谢各位捧场 不把form的BordStyle设成bsNonecall up fucntion and 把form的BordStyle设成bsNone在外观上有what deference. put these into formcreatewidth:=width-1`;width:=width+1; To wfhlxl() : 我试了,这样还是没有达到bsNone的样式:也就是说窗体四周还有边框! 我现在是要将一张图片alClient到form上,如果用你的方法,运行时窗体四周还是有边框很难看,而bsNone后整个窗体都是被图片覆盖的。 午饭去了,谢谢各位的热心,揭帖了 delphi的浏览器控件和控件flash的问题 关于.xml结点的修改《难啊》 如何分别得到 year ,month ,day? 如何让用户自己设计窗口,并在窗口中添加控件? 个人主页开张 http://realuml.24cc.com/ Com,我是越看越没有信心了..越看越不懂...哇......我快不行了..(来者有分). 紧急求救:硬盘故障 listbox的某一行是否能改变颜色? 新年好!大家好,为什么我的全局hook只对本进程有效,在别得界面按下按键都hook不到? 招兼职(delphi + fastreport) 程序出错,未找到原因,请教大家! 如何在Word里头绘图?有否例子
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
lpRect:TRect;
mess1:string;
procedure hitit(var msg:TWMNCHITTEST);
message WM_NCHITTEST;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.hitit(var msg: TWMNCHITTEST);
var
pt:TPoint;
begin
pt.x:=msg.XPos;
pt.y:=msg.YPos;
pt:=ScreenToClient(pt);if ptInRect(Rect(lpRect.Right-5,lpRect.Top+5,
lpRect.Right+5,lpRect.Bottom-5),pt) then
msg.Result:=HTRIGHT;//右边
if ptInRect(Rect(lpRect.Left-5,lpRect.Top+5,
lpRect.Left+5,lpRect.Bottom-5),pt) then
msg.Result:=HTLEFT; //左边if ptInRect(Rect(lpRect.Left+5,lpRect.Top-5,
lpRect.Right-5,lpRect.Top+5),pt) then
msg.Result:=HTTOP; //上边
if ptInRect(Rect(lpRect.Left+5,lpRect.Bottom-5,
lpRect.Right-5,lpRect.Bottom+5),pt) then
msg.Result:=HTBOTTOM; //下边if ptinRect(Rect(lpRect.Left-5,lpRect.Top-5,
lpRect.Left+5,lpRect.Top+5),pt) then
msg.Result:=HTTOPLEFT;//左上角
if ptInRect(Rect(lpRect.Right-5,lpRect.Bottom-5,
lpRect.Right+5,lpRect.Bottom+5),pt) then
msg.Result:=HTBOTTOMRIGHT;//右下角if ptInRect(Rect(lpRect.Left-5,lpRect.Bottom-5,
lpRect.Left+5,lpRect.Bottom+5),pt) then
msg.Result:=HTBOTTOMLEFT; //左下角
if ptInRect(Rect(lpRect.Right-5,lpRect.Left-5,
lpRect.Right+5,lpRect.Left+5),pt) then
msg.Result:=HTTOPRIGHT; //右上角end;procedure TForm1.FormCreate(Sender: TObject);
begin
lpRect:=ClientRect;
end;procedure TForm1.FormResize(Sender: TObject);
begin
lpRect:=ClientRect;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;end.
setwindowlong(handle,GWL_STYLE, getwindowlong(handle,GWL_STYLE) and (not WS_CAPTION));
还有其他的答案嘛? 中午午饭前揭帖。谢谢各位捧场
call up fucntion and 把form的BordStyle设成bsNone
在外观上有what deference.
width:=width-1`;
width:=width+1;
我试了,这样还是没有达到bsNone的样式:也就是说窗体四周还有边框! 我现在是要将一张图片alClient到form上,如果用你的方法,运行时窗体四周还是有边框很难看,而bsNone后整个窗体都是被图片覆盖的。
午饭去了,谢谢各位的热心,揭帖了