如何设置大于1096像素的表格高度? [英] How to set form height larger than 1096 pixels?
问题描述
我正在使用C ++ Builder XE7并遇到一个奇怪的问题。我需要一个表格高度大约为1500像素。问题是对象检查器不允许我指定大于1096像素的值。如果我设置任何较大的值,它将自动设置为1096。任何现有或新窗体上均存在问题。我使用的屏幕分辨率为1920x1080的Windows 7。
I am using C++ Builder XE7 and having a strange problem. I need a form height to be about 1500 pixels. The problem is that object inspector does not allow me to specify value that is larger then 1096 pixels. If I set any larger value it is automatically set to 1096.. The problem exists on any existing or new form. I'm using Windows 7 with screen resolution 1920x1080.
推荐答案
此行为的原因是,当您未设置约束时表单大小时,Delphi将通过 WM_GETMINMAXINFO
消息,当delphi通过 SetWindowPos
函数。对于最大高度,Delphi使用的ptMaxTrackSize.Y成员在我的Windows 8.1系统(1920x1080分辨率)上恰好是1092。
The reason for this behavior is that when you do not set constraints for the form size, Delphi will automatically get constraints at system level via the WM_GETMINMAXINFO
message, which is fired when delphi sets the form size via the SetWindowPos
function. For the maximum height, Delphi uses the ptMaxTrackSize.Y member which happens to be 1092 on my windows 8.1 system (1920x1080 resolution).
因此,如果您要强制形成高度高于系统桌面高度,则必须使用 Constraints.MaxHeight
覆盖此行为。您可以通过在 Vcl.Forms
单元中的过程 TCustomForm.WMGetMinMaxInfo
中设置断点来进行检查。
So if you want to force form heights higher than the system desktop height, you must use Constraints.MaxHeight
to override this behavior. You can check this out by setting a breakpoint in procedure TCustomForm.WMGetMinMaxInfo
in the Vcl.Forms
unit.
这篇关于如何设置大于1096像素的表格高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!