|  | 
| How to add Icon for ?TrackPopupMenu | 
| Post Reply   | 
| Author | |
| sanbao439   Newbie   Joined: 18 June 2008 Location: China Status: Offline Points: 7 |  Post Options  Thanks(0)  Quote  Reply  Topic: How to add Icon for ?TrackPopupMenu Posted: 18 June 2008 at 2:20am | 
| 
   I create a popupmenu, but don't know how to add icon for it.
 CMenu menu; VERIFY(menu.LoadMenu(IDR_MENU_POPUP)); CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(GetCommandBars()); CMenu* pPopup = menu.GetSubMenu(0); pPopupBar->LoadMenu(pPopup); CXTPCommandBars::TrackPopupMenu(pPopupBar, (TPM_RECURSE | TPM_RIGHTBUTTON | TPM_NONOTIFY), point.x, point.y, this); pPopupBar->GetImageManager()->SetIcons(IDB_BITMAP_TREE, IDR_MAINFRAME_ALPHA, xtpImageNormal); pPopupBar->InternalRelease(); pPopupBar = NULL; | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 18 June 2008 at 3:30am | 
| 
   Code is right. 
 Just switch pPopupBar->GetImageManager()->SetIcons and  CXTPCommandBars::TrackPopupMenu lines :-) | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| sanbao439   Newbie   Joined: 18 June 2008 Location: China Status: Offline Points: 7 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 June 2008 at 3:22am | 
| I switched it! but It can't display icon! Can you give me a sample about right-click menu? I can't find the sample in your sample with XTPToolkitPro. Thanks a lot. | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 June 2008 at 3:11pm | 
| 
   Hi,
 Check Samples\CommandBars\CustomThemes sample, | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| 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 |