![]() |
How to enable menu item on popup? |
Post Reply
|
| Author | |
jeffcmj
Groupie
Joined: 28 October 2004 Status: Offline Points: 92 |
Post Options
Thanks(0)
Quote Reply
Topic: How to enable menu item on popup?Posted: 15 October 2005 at 7:40am |
|
Hi, I use the following code to show a popup menu int nID = CXTPCommandBars::TrackPopupMenu(&menu, TPM_RIGHTBUTTON|TPM_RECURSE|TPM_RETURNCMD, pt.x, pt.y, AfxGetMainWnd(),NULL,NULL,pBars); My question is the menu items are all disabled, since I don't have a command handler. With MFC I can disable CMainFrame::m_bAutoMenuEnable to have them enabled, but with XTP, it does not work. Please advise. Thanks Jeff |
|
![]() |
|
jeffcmj
Groupie
Joined: 28 October 2004 Status: Offline Points: 92 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 October 2005 at 8:53am |
|
I solve it myself by adding TPM_NONOTIFY flag.
|
|
![]() |
|
umcbrad
Newbie
Joined: 26 April 2005 Status: Offline Points: 10 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2005 at 9:36am |
|
I would like some help with this problem also....menus is always grayed out...I can't seem to fix it... As usual, it seems to work in the examples, but I can't see why... I am trying to invoke it is the view of an MDI app. Here is my code void CVanGoghView::OnRButtonDown(UINT nFlags, CPoint point) ClientToScreen(&point);
thanks,
Brad |
|
![]() |
|
umcbrad
Newbie
Joined: 26 April 2005 Status: Offline Points: 10 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2005 at 9:40am |
|
I also tried this, and it doesn't work... CMenu mnu; |
|
![]() |
|
jeffcmj
Groupie
Joined: 28 October 2004 Status: Offline Points: 92 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2005 at 10:56am |
|
You shall have a command handler for the grayed command.
|
|
![]() |
|
umcbrad
Newbie
Joined: 26 April 2005 Status: Offline Points: 10 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 December 2005 at 10:56am |
|
ah, yes...I was overlooking that...thanks for the help!
|
|
![]() |
|
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 |