How to add a string after ICON of toolbar
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11548
Printed Date: 19 June 2025 at 5:30am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: How to add a string after ICON of toolbar
Posted By: yanlv
Subject: How to add a string after ICON of toolbar
Date Posted: 23 July 2008 at 3:26am
just like the CToolBar's member function: SetButtonText() in MFC.
|
Replies:
Posted By: mgampi
Date Posted: 23 July 2008 at 4:53am
Hi;
If you're using CommandBars try this:
int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) { if (lpCreateControl->bToolBar) { CXTPToolBar* pToolBar = DYNAMIC_DOWNCAST(CXTPToolBar, lpCreateControl->pCommandBar); if (!pToolBar) return FALSE;
if (lpCreateControl->nID==ID_FULLSCREEN) { lpCreateControl->buttonStyle=xtpButtonIconAndCaption; return TRUE; } } return FALSE; } It then takes the text from your resource file.
------------- Martin
Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022
|
Posted By: yanlv
Date Posted: 23 July 2008 at 11:10pm
Thanks. This way to add string after icon works for the lpCreateControl->controlType = xtpControlPopup; i.e., there are some pull down items when you click the icon. But if there are no pull down items, i.e., this icon is a common toolbar, e.g., click it will open a dialog, I tried this way, in details: Add Menu in the resource file, the menu ID = ID_FULLSCREEN, and add string on the caption. Then add the similar code you suggested in MainFrame. But it turns out there's still no string after icon. Anything wrong. If I'm not clear, please tell me. Thanks very much.
|
Posted By: yanlv
Date Posted: 24 July 2008 at 7:53am
I know the answer, thanks any way.
|
Posted By: mgampi
Date Posted: 24 July 2008 at 9:17am
Hi;
Could you share your experiences?
------------- Martin
Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022
|
Posted By: yanlv
Date Posted: 24 July 2008 at 10:07pm
needn't create a menu for ID=ID_FULLSCREEN. Add your string on the prompt of the Toolbar Button Properties: e.g. smile\nsmile.
|
Posted By: rapid
Date Posted: 06 June 2011 at 5:38pm
I would like to display the icon after the caption (toolbar button).. How to do that..? Any idea would be much appreciated..
Thanks & Regards
|
|