|
-
July 28th, 1999, 07:31 PM
#1
popup menu
how can i create a popup-contetxmenu (e.g when i click somewhere in the document window)? i created a menubar in the resourceeditor but will it work with an ordinary meunbar? how do I create and display such a menu?
-
July 29th, 1999, 01:40 AM
#2
Re: popup menu
1)In resource editor create a menu resource
2)Go to menu item properties and at caption type a space(no name but u must type something so type a space)
3)Then add to this no name menu all items you need, then try this function:
void CInsCol::OnRButtonDown(UINT nFlags, CPoint point)
{
CMenu m_Menu;
CPoint point;
GetCursorPos(&point);
m_Menu.LoadMenu( IDR_MENU1 );
CMenu* pPopup = m_Menu.GetSubMenu( 0 );
pPopup->TrackPopupMenu( TPM_RIGHTBUTTON, point.x, point.y, this );
CDialog::OnRButtonDown(nFlags, point);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|