开发者

Can I lock the width or height of an MFC dialog during resizing?

开发者 https://www.devze.com 2023-02-15 19:54 出处:网络
Is there a way to开发者_运维知识库 lock a dialog box\'s size in one direction (restrict only width or only height) in MFC? You need to override OnGetMinMaxInfo. In OnInitDialog you can capture the cur

Is there a way to开发者_运维知识库 lock a dialog box's size in one direction (restrict only width or only height) in MFC?


You need to override OnGetMinMaxInfo. In OnInitDialog you can capture the current height, and then use it for both minimum and maximum height. Call __super::OnGetMinMaxInfo first and then only change the height members. Note that the window may not exist the first couple times OnGetMinMaxInfo are called.

Here's a detailed article on GetMinMaxInfo.

0

精彩评论

暂无评论...
验证码 换一张
取 消