Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CControlBar initial size Collapse All
Subject Author Date
Emmanuel Verguet Oct 26, 2007 - 8:06 AM

Hello,

I have the following problem. I have a dialog which size is 612x14 (in resources units), with child style and no borde. It is embedded in a control bar. Initial docked height of this CControlBar is around 100 pixels, not around 40 pixels. So I have a lot of space below the controls. I guess I have to use SetInitDesiredSizeHorizontal(), but I don’t find the way to compute my 14 pixel resource unit + height of CControlBar caption.

Thanks.

Technical Support Oct 26, 2007 - 1:11 PM

Here is how you can retrieve the size of the child dialog

CRect rc;
m_wndBarDlg.GetClientRect(rc);
CSize sz = CSize(rc.Width(),rc.Height());
And below is how you can get the height of the control bar borders
CRect rcClient;
m_wndBar.GetClientRect(rcClient);
CRect rcWnd;
m_wndBar.GetWindowRect(rcWnd);
INT nHeight = rcWnd.Height() - rcClient.Height();