![]() |
How to force the Ribbon to update its controls |
Post Reply ![]() |
Author | |
SvenC ![]() Groupie ![]() Joined: 02 February 2007 Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
markr ![]() Senior Member ![]() Joined: 01 August 2004 Status: Offline Points: 443 |
![]() ![]() ![]() ![]() ![]() |
Hi, have you tried:
GetCommandBars()->RedrawCommandBars(); |
|
![]() |
|
SvenC ![]() Groupie ![]() Joined: 02 February 2007 Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() |
Thanks mark,
no I didn't find that method.
And yes, it does redraw the popup control
![]() 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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |