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.
精彩评论