Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

How to make a resizab;e dialog at only one dimension (height or width)?

How to make a resizab;e dialog at only one dimension (height or width)?
Thanks,
0
pbtdanh
Asked:
pbtdanh
  • 2
  • 2
1 Solution
 
migelCommented:
Hi!
you can override WM_NCHITTEST
and check for HTBOTTOM (HTTOP) to restrict vertical resizing
or HTLEFT (HTRIGHT) to restrict horz resizing;
for example:

afx_msg UINT CMyDislog::OnNcHitTest( CPoint point )
{
UINT uHt = CDialog::OnNcHitTest(point);
// for example resttrict vert resize:
if (uHt == HTBOTTOM || uHt == HTTOP)
return HTBORDER;
if (uHt == HTTOPLEFT || uHt == HTBITTOMLEFT))
return HTLEFT;
if( uHt == HTTOPRIGHT || uHt == HTBOTTOMRIGHT)
return HTRIGHT;
//default processing
return uHt;
}
0
 
pbtdanhAuthor Commented:
Thanks for helping me.
0
 
pbtdanhAuthor Commented:
Thanks for helping me.
0
 
migelCommented:
but why B????
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now