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.
Subject |
Author |
Date |
|
Andrew Nanopoulos
|
Apr 12, 2006 - 9:42 AM
|
I have a CExtLabel that is loaded in a tollbar. How can I resize the text contained in that control, and have the toolbar and the control resize accordingly?
|
|
Technical Support
|
Apr 13, 2006 - 1:06 AM
|
You can measure the size of the label with the CDC::DrawText() method (specify DT_CALCRECT for nFormat ). After that you can change the size of the label window using the CWnd::SetWindowPos() method (specify SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_NOREDRAW in the nFlags parameter). Finally, recompute the layout of toolbar’s parent frame using pToolBar->GetParentFrame()->RecalcLayout() .
|
|