Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - [Closed] Changing Caption / Width
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Closed] Changing Caption / Width

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: [Closed] Changing Caption / Width
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.