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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With