![]() |
How to add a string after ICON of toolbar |
Post Reply ![]() |
Author | |
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() Posted: 23 July 2008 at 3:26am |
just like the CToolBar's member function: SetButtonText() in MFC.
|
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
I know the answer, thanks any way.
|
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
yanlv ![]() Groupie ![]() Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
![]() ![]() ![]() ![]() ![]() |
needn't create a menu for ID=ID_FULLSCREEN. Add your string on the prompt of the Toolbar Button Properties: e.g. smile\nsmile.
|
|
![]() |
|
rapid ![]() Groupie ![]() Joined: 11 March 2009 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
I would like to display the icon after the caption (toolbar button).. How to do that..?
Any idea would be much appreciated.. Thanks & Regards |
|
![]() |
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 |