Home > Software engineering >  MFC how by right-clicking in the display menu, and then click on a sub menu dialog
MFC how by right-clicking in the display menu, and then click on a sub menu dialog

Time:10-02

Dialog box can enter inside some sphere attribute values, and then can be added in the client area of the original ball, at the same time also can delete to delete the ball,

CodePudding user response:

What is mainly through the right mouse button, a menu, and then click on one of them, can appear can add or remove a sphere dialog,

CodePudding user response:

Right-click menu generally handle WM_CONTEXTMENU messages, LoadMenu GetSubMenu TrackPopupMenu
General process WM_COMMAND message

CodePudding user response:

Want to know the specific how to write

CodePudding user response:

1. Create a Menu to the Menu resource,
2. In response to the client area of the specified control mouse right click events, use the TrackPopupMenu function loading right-click pop-up menu,
3. Write a message response function of the menu resource,

Need to use some of the functions,

BOOL CMenu: : TrackPopupMenu
(UINT nFlags, int x, int y, CWind * pWnd, LPCRECT lpRect=NULL);
Parameter description:
NFlags: the location of the menu display (lower left corner at the bottom right corner, etc.) : TPM_CENTERALIGE
(x, y coordinates to screen coordinates); Screen coordinates and the client area coordinates transform
PWnd have pop-up menu window,
Indicates the rectangular area, empty
The pop-up menu,
The ClientToScreen (point);

CodePudding user response:

The menu TAB in order to realize the corresponding function how to write,
, for example, press the add, can you bring up a can input all the properties dialog box, press ok can add

CodePudding user response:

http://blog.csdn.net/u010412719/article/details/47303011

CodePudding user response:

I'm stupid, you want me to this problem specific what to write, time is pressing

CodePudding user response:

How can I
Press the menu of adding pop-up I built in the resource dialog box

CodePudding user response:

Enter ball attributes, and then press is made, it can be shown in the original view, how to do
  • Related