![]() |
How to change the icon dynamicaly? |
Post Reply
|
| Author | ||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Topic: How to change the icon dynamicaly?Posted: 07 October 2004 at 3:37am |
|
|
Hello How to change icon, animation in toolbar dynamicaly? Please help me. Thanks |
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 October 2004 at 6:24am |
|
|
So you need to change icon or add animated icon?
|
||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 October 2004 at 8:20pm |
|
|
Yes. I want to do the following somethings 1.After clicked a button in toolbar, I want to change the icon of button to a animation, and then clicked the animation button once more, I need to change it to icon. 2.I need to display some icons in toolbar (not button), and dynamicaly change them to animations or other icons. Please help me. Thanks
|
||
![]() |
||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 October 2004 at 3:02am |
|
|
I added the following code to my project , but the icon of button in toolbar can not be changed. Please help me why. CXTPCommandBars* pCommandBar = GetCommandBars(); CXTPControl* pCtl = pCommandBar->FindControl( xtpControlButton, ID_ANIMATION_TEST, TRUE, TRUE );
|
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 October 2004 at 2:18am |
|
|
index in SetIconId points to icon in IconManager. in OnCreate: pCommandBars()->GetImageManager()->SetIcons(IDB_BITMAP 1,....)
if Customization is enabled in your program, don't use FindControl, user can move/delete button. Use Update Handler to update button's icon. void CCustomThemesView::OnUpdateBack(CCmdUI* pCmdUI)
}
|
||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 October 2004 at 3:11am |
|
|
Thank you very much. By your way, I can change it, now there is a problem. when I clicked the button, the program crashed. I dont know why. Please help me. My source code is as the following 1. OnCreate() UINT nCommands[] = {1,2}; 2.void CMainFrame::OnUpdateAnimationTest(CCmdUI* pCmdUI) CXTPControl* pControl = CXTPControl::FromUI(pCmdUI); pControl->SetIconId(m_bTestIconFlg? 1: 2); }Is it right?
|
||
![]() |
||
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 |