怎样让窗口不移动或…… 我的窗口中有一个主窗口。其它为子窗口。可是当子窗口移动到某些地方时主窗口的下凹部分就出现了滚动条,那样太难看呀。 我想要么就让子窗口不能移动或是限制子窗口移动范围使得主窗口不要出现滚动条,可惜我做不到! 兄弟们来看看吧,最好是用第二种方法。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把BorderStyle设置为bsSingle就行了 利用下面两个消息,完全搞掂:WM_MOVINGWM_SIZING前者控制鼠标按住窗口标题栏时窗口整体的移动,后者控制鼠标拖动窗口边框时的窗口尺寸的改变。 wm_movingwm_sizing具体点?参数? 我知道原理,但没条件调试。希望对你有帮助!windows.ClipCursor(rect); 好像假如一句话就可以了,inherited; 禁止窗体移动 typeTForm1 = class(TForm)privateprocedure wmnchittest(var msg:twmnchittest); message wm_nchittest;{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.DFM}procedure TForm1.wmnchittest(var msg:twmnchittest);begininherited;if (htcaption = msg.result) then msg.result:=htclient;end; end. 窗口的Align设成alCustom,窗口不能移动 1)添加变量var Form1:TForm1; oleft:Integer; otop:Integer; owidth:Integer; ohight:Integer;2)保存窗体的原始大小和位置 procedure TForm1.FormCreate(Sender:Tobject); begin oleft:=Left; otop:=Top; owidth:=Width; oheigth:=Height; end;4)添加处理WM_WINDOWPOSCHANGING过程 type TForm1=class(TForm) Lable1:TLable; procedure windowsposchange(var Msg:TWMWINDOWPOSCHANGING); message WM_WINDOWPOSCHANGING; procedure FormCreate(Sender:Tobject); . . .其具体 定义如下: procedure TForm1.windowsposchange(var Msg:TWMWINDOWPOSCHANGING); begin Msg.WindowPos.x:=oleft; Msg.WindowPos.y:=otop; Msg.WindowPos.cx:=owidth; Msg.WindowPos.cy:=oheight; inherited; end; .... procedure WMNCHitTest(var Msg:TMessage);message WM_NCHITTEST;procedure TFormMain.WMNCHitTest(var Msg:TMessage);begin if FMoveable then inherited else Msg.Result:=1;end; to tonylk(tony) 你的方法不成功。 简单问题 求助。如何计算下边的数值 有一句SQL语句关于日期查找帮忙 谢谢 高分急求问:如何实现让一个图片上显示凸出透明感觉? cxGrid中如何知道选择了几条记录? 1000分!!发送内嵌图片邮件 --谁能给个例子,立即发分 求清除Access97密码的程序代码? use xxunit除了用手工添加,有没有快捷的办法呢? 用 vispdf 生成PDF文件时,中文显示乱码?有什么办法解决? 请教SQL高手,谁用过下面的SQL语句 对Jpg文件的不兼容 在线求救!!!哪位大侠知道管家婆标准版3.5的注册机???? 关于自定义函数及调用问题!在线等待!
WM_MOVING
WM_SIZING
前者控制鼠标按住窗口标题栏时窗口整体的移动,
后者控制鼠标拖动窗口边框时的窗口尺寸的改变。
wm_sizing
具体点?参数?
希望对你有帮助!
windows.ClipCursor(rect);
typeTForm1 = class(TForm)privateprocedure wmnchittest(var msg:twmnchittest); message wm_nchittest;{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.DFM}procedure TForm1.wmnchittest(var msg:twmnchittest);begininherited;if (htcaption = msg.result) then msg.result:=htclient;end; end.
var
Form1:TForm1;
oleft:Integer;
otop:Integer;
owidth:Integer;
ohight:Integer;
2)保存窗体的原始大小和位置
procedure TForm1.FormCreate(Sender:Tobject);
begin
oleft:=Left;
otop:=Top;
owidth:=Width;
oheigth:=Height;
end;
4)添加处理WM_WINDOWPOSCHANGING过程
type
TForm1=class(TForm)
Lable1:TLable;
procedure windowsposchange(var Msg:TWMWINDOWPOSCHANGING);
message WM_WINDOWPOSCHANGING;
procedure FormCreate(Sender:Tobject);
.
.
.
其具体 定义如下:
procedure TForm1.windowsposchange(var Msg:TWMWINDOWPOSCHANGING);
begin
Msg.WindowPos.x:=oleft;
Msg.WindowPos.y:=otop;
Msg.WindowPos.cx:=owidth;
Msg.WindowPos.cy:=oheight;
inherited;
end;
....
procedure TFormMain.WMNCHitTest(var Msg:TMessage);
begin
if FMoveable then
inherited
else
Msg.Result:=1;
end;