How to set form height larger than 1096 pixels?

☆樱花仙子☆ 提交于 2019-12-12 10:37:06

问题


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.


回答1:


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).

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.



来源:https://stackoverflow.com/questions/35577709/how-to-set-form-height-larger-than-1096-pixels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!