Print Page | Close Window

How to force the Ribbon to update its controls

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=18237
Printed Date: 04 October 2024 at 9:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to force the Ribbon to update its controls
Posted By: SvenC
Subject: How to force the Ribbon to update its controls
Date Posted: 18 April 2011 at 10:10am
I use a SplitButtonPopup in a Ribbon and want to make the last clicked menu item the default for clicking the button itself.
 
To achieve that I reset the ID, Caption, Prompt and IconID of that control after it was clicked.
As the caption text of the different menu entries have different length, the button text get clipped when a longer text replaces a shorter text. Resizing the main window where the Ribbon lives in does redraw the button with its correct size.
 
I tried InvalidateRect(NULL, TRUE) on the mainframe and the ribbon but that did not redraw the window.
Only SetWindowPos with +1 width and SetWindowPos with the old width did update the buttons size.
 
Is there another method to force redrawing ribbon controls?
 
Resizing the main window just does not feel right...
 
Thanks,
Sven


-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017



Replies:
Posted By: markr
Date Posted: 18 April 2011 at 10:02pm
Hi, have you tried:

GetCommandBars()->RedrawCommandBars();


Posted By: SvenC
Date Posted: 19 April 2011 at 1:32am
Thanks mark,
 
no I didn't find that method.
 
And yes, it does redraw the popup control Smile
 
Thank you,
Sven


-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017



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