Print Page | Close Window

Toolbar reset makes SetCaption() undone?

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=9334
Printed Date: 29 September 2024 at 12:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar reset makes SetCaption() undone?
Posted By: znakeeye
Subject: Toolbar reset makes SetCaption() undone?
Date Posted: 17 January 2008 at 10:05am

I have a toolbar which is loaded from a resource IDR_TOOL. Then I replace certain strings using FindControl(...)->SetCaption(...). Now, if the user clicks "Reset toolbar" in the application my custom caption strings seem to be reset.

Is this the right behavior? I guess I have to catch a "reset" event and call SetCaption again... am I right?
 
Thanks!



Replies:
Posted By: znakeeye
Date Posted: 17 January 2008 at 11:11am
ON_MESSAGE(WM_XTP_CUSTOMIZATION_RESETTOOLBAR, OnResetToolBar)
 
Then update the toolbar captions in OnResetToolBar. In case somebody encounters the same problem...


Posted By: Oleg
Date Posted: 18 January 2008 at 2:15am

Hi,

Better in OnCreate after you modifyed all buttons and before you call  LoadCommandBars add
 
pToolBar->GetControls()->CreateOriginalControls(); - it will create "original" version to reset.


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



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