Print Page | Close Window

[Closed] Changing Caption / Width

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5523
Printed Date: 21 November 2024 at 9:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Closed] Changing Caption / Width
Posted By: Simon HB9DRV
Subject: [Closed] Changing Caption / Width
Date Posted: 15 November 2006 at 3:57am
In the picture below I am failing to have the controls in the second toolbar change width when I change the captions, the captions can change dynamically. This is a modeless dialog.

In another situation where I have a dialog which can be resized as a child of a CFormView I do not have this problem with a toolbar with the same captions. As far as I can tell I have identical code.

The widths you see are based on the caption defined for the toolbar in Visual Studio (the Prompt field).

How do I force a toolbar to resize the controls based on the caption text?

I confused myself badly and ended up chasing my tail through the Codejock sources.

Many thanks, Simon




-------------
Simon HB9DRV



Replies:
Posted By: Oleg
Date Posted: 15 November 2006 at 4:40am
Hello,
 
In Dialog case when caption changed, Toolbar sends WM_SIZE to dialog to allow reposition self.
 
Call RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
in OnSize handler of your dialog.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Simon HB9DRV
Date Posted: 15 November 2006 at 4:52am
Thanks - works great.

Being a modeless non-resizable dialog I didn't have a WM_SIZE handler.

Cheers,


-------------
Simon HB9DRV



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net