开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜