![]() |
[solved] how to add submenu? |
Post Reply ![]() |
Author | |
ksc4703 ![]() Newbie ![]() Joined: 04 November 2016 Location: south korea Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 06 November 2016 at 9:47pm |
hi! i'm trying to add submenu as a popup item. My project does not have a red box menu below. ![]() CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAIN_MENU); CXTPControls* pControls = pMenuBar->GetControls(); CXTPControl* pControl = pControls->GetAt(5); // <== "Tools" CXTPControls* pUtilCtrls = pControl->GetCommandBar()->GetControls(); CXTPControl* pSubMenuItemCtrl = pUtilCtrls->GetAt(2); // <== "Item3" // make some menu for dynamic menu. CMenu SubMenu; SubMenu.CreatePopupMenu(); InsertMenu(SubMenu, 0, MF_BYPOSITION | MF_STRING, IDD_DYNAMIC+1, _T("Item3-1")); InsertMenu(SubMenu, 0, MF_BYPOSITION | MF_STRING, IDD_DYNAMIC+2, _T("Item3-2")); InsertMenu(SubMenu, 0, MF_BYPOSITION | MF_STRING, IDD_DYNAMIC+3, _T("Item3-3")); pSubMenuItemCtrl ->GetControls()->AddMenuItem(&SubMenu, 0); pSubMenuItemCtrl ->GetControls()->AddMenuItem(&SubMenu, 1); pSubMenuItemCtrl ->GetControls()->AddMenuItem(&SubMenu, 2); but result is below. ![]() How to do this? |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
|
|
![]() |
|
ksc4703 ![]() Newbie ![]() Joined: 04 November 2016 Location: south korea Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Hi,
![]() Thank you for your response. It works well. Problem solved.
|
|
![]() |
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 |