• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • 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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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