发信人: mendy.bbs@bbs.nju.edu.cn (孟迪), 信区: cnprogram
标 题: How to set a max and min form size
发信站: nju_bbs (Sun Apr 19 09:19:43 1998)
转信站: Lilac!ustcnews!nju_bbs
发信人: njhe (he要破产), 信区: RAD
标 题: How to set a max and min form size
发信站: '3m紫金飞鸿m' (Mon Mar 9 18:03:15 1998) , 站内信件
Product: Delphi
Version: All
Platform: Windows/Win32
When you want to control how much your users can resize your
form, you can control that by setting the MinMax values. (If
you use the resize method to limit the size, it will work, but
it won't look quite as good.)
Note: To make it so that the user cannot change the form's
size at all, make the min and max sizes the same values.
This is an example of how to declare and use the wm_GetMinMaxInfo
windows message in your applications.
unit MinMax;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMGetMinMaxInfo(var MSG: Tmessage); message WM_GetMinMaxInfo;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMGetMinMaxInfo(var MSG: Tmessage);
Begin
inherited;
with PMinMaxInfo(MSG.lparam)^ do
begin
with ptMinTrackSize do
begin
X := 300;
Y := 150;
end;
with ptMaxTrackSize do
begin
X := 350;
Y := 250;
end;
end;
end
end.
--
不惜一切代价,达到修炼的真义。
遇神阻则弑神,遇佛阻则弑佛。
m;31m※ 来源:·紫金飞鸿 bbs.njupt.edu.cn·[FROM: 202.119.236.104]m
--
※ 来源:.南大小百合信息交换站 bbs.nju.edu.cn.[FROM: a507yjh.nju.edu]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.017毫秒