Home > Software engineering >  About the toolbar button to display only in the text, do not display icon
About the toolbar button to display only in the text, do not display icon

Time:09-22

How to show only the text in toolbar button, does not display the icon, and text to center

CodePudding user response:

M_wndToolBar1. CreateEx (this, TBSTYLE_FLAT WS_CHILD | WS_VISIBLE |
CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
//CMD ID
UINT IDArray []={ID_BT_1 ID_SEPARATOR, ID_BT_2, ID_SEPARATOR,
ID_BT_3 ID_SEPARATOR, ID_BT_4 ID_SEPARATOR,
ID_BT_5 ID_SEPARATOR, ID_BT_6 ID_SEPARATOR,
ID_BT_7 ID_SEPARATOR, ID_BT_8 ID_SEPARATOR, ID_BT_9};
Int nIDCount=sizeof (IDArray)/sizeof (UINT);
M_wndToolBar1. SetButtons (IDArray nIDCount);
For (int jj=0; Jj{//have to be inside the 'for'!!! If the text under img
M_wndToolBar1. SetSizes (CSize (28, 28), CSize (1, 1));//ICONS only 1
If (m_wndToolBar1. GetButtonStyle (jj)==TBBS_SEPARATOR) continue;
M_wndToolBar1. SetButtonText (jj, "test");
}

CodePudding user response:

Although does not display the icon, but the height of the button becomes, if can not only keep the button, can let the ICONS don't show is perfect

CodePudding user response:

SetSizes ( CSize (28, 28) , CSize height (1, 1)//button

CodePudding user response:

  • Related