使用Anchors属性,
帮助里讲的很明确:
Specifies how the control is anchored to its parent.property Anchors: TAnchors;DescriptionUse Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored.If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to [akLeft,akRight], the control stretches when the width of its parent changes.Anchors is enforced only when the parent is resized. Thus, for example, if a control is anchored to opposite edges of a form at design time and the form is created in a maximized state, the control is not stretched because the form is not resized after the control is created.Note: If a control should maintain contact with three edges of its parent (hugging one side of the parent and stretching the length of that side), use the Align property instead. Unlike Anchors, Align allows controls to adjust to changes in the size of other aligned sibling controls as well as changes to the parent抯 size.
帮助里讲的很明确:
Specifies how the control is anchored to its parent.property Anchors: TAnchors;DescriptionUse Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored.If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to [akLeft,akRight], the control stretches when the width of its parent changes.Anchors is enforced only when the parent is resized. Thus, for example, if a control is anchored to opposite edges of a form at design time and the form is created in a maximized state, the control is not stretched because the form is not resized after the control is created.Note: If a control should maintain contact with three edges of its parent (hugging one side of the parent and stretching the length of that side), use the Align property instead. Unlike Anchors, Align allows controls to adjust to changes in the size of other aligned sibling controls as well as changes to the parent抯 size.
解决方案 »
- 怎样设置TreeList不能选择父节点?
- indy退出老是出错??
- nt service程序一问
- 请教高手:数据库中bit字段在dbgrid中显示情况?!
- 怎样屏蔽ListView的输入焦点!??
- QQ2004杀死了钩子吗?
- 我一打开IE浏览器,进程中就会出现sapisvr.exe,而且占用CPU很厉害,我该如何去掉?
- 我想做个三态的图象控件,但是对大一点的图片更新速度很慢,怎么解决呢?
- 请问,TTabel的事件捕获的原理?
- 为了这个,我重装win98四次,delphi5六次,金山毒霸9。14版杀毒六次以上。
- 大伙能帮我一下吗(送分了)?
- SQL语言执行后的缓冲内存怎么释放?本人用了一些DELPHI的数据库控件,发现在对相关数据库进行频繁操作时,应用程序内存不断增加,请大家
一般可以设置以下的属性:
窗体:autosize:=true;
窗体上的组件可以从功能上分为几个区域,每个区域可放在panel组件上,然后根据需要设置panel组件的align为除alnone外的其他值。这样的话,在不同的机器上
系统都会根据需要缩放窗体,保持一定的比例。
另外,在不同的系统上编的程序,在其他系统上可能会出现比例不一致
可以作如下设置:
scaled:=false;
字符属性:宋体、中文字符集为CHINESE_GB2312
你可以尽量多用Panel,我就是用它来应付不同机的分辨率不同
在窗体的ON_resize(不大记得)事件中加入语句。
控件的位置值与窗体的位置值有着一定的比例关系。
只要在用户改变窗体大小的同时,按照原来的比例关系改变控件的大小便行了。我是个初学者,对代码还不熟,请不要见怪。
为了节约时间,我只大概提一下。
例如:窗体原始大小
FORM1.width:=500;
edit1.width:=56;
事件:
form_onresize
edit1.width:=form1.width/500/56;
上述例子只改变宽度,但照做可能不行。(我只在VB实现过);
但按比例不变的思想来改变大小,应该不会错。