Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I have MDI application (with vc++ 6.0) with 1 toolbar, how can i change one of icons with the new icon? :doh:
Posted

1 solution

Open the toolbar using the resource editor and update the specific button-icon that you want to change.

[Edit]
-------

Based on your comment, it seems you want to do this at runtime and on a specific button. If so, you can use CToolBarCtrl::SetButtonInfo. Just set the appropriate image index using the TBBUTTONINFO structure.
 
Share this answer
 
v2
Comments
mohammadmot 3-Nov-10 11:02am    
No, i mean how can change into the code !
for ex: i have icon to show recording mode with green and red led, how can i change toolbar icon (Green to Red or reverse?) "with code" run time?
thanks
Nish Nishant 3-Nov-10 11:07am    
Updated my response.
mohammadmot 3-Nov-10 11:19am    
can you help more, with small code(ID_ICON1 replace with ID_ICON2)?
how can fill this structure (TBBUTTONINFO)?
typedef struct {
UINT cbSize;
DWORD dwMask;
int idCommand;
int iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
DWORD_PTR lParam;
LPTSTR pszText;
int cchText;
} TBBUTTONINFO, *LPTBBUTTONINFO;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900