devxlogo

Custom Right-Mouse-Click Menus

Custom Right-Mouse-Click Menus

Question:
How do I customize the mouse’s right-click menu? That is, instead of Cut, Copy, Paste, Select All, Delete in Edit-Masks, etc., I would like to display my custom menu, which includes Save, Refresh, etc.

Answer:
In order to have your own custom menus you need to define the menu in the normal manner through the menu painter. Alternatively, you can use a sub-menu from your Sheets menu. (This is the option that most people choose.)

Then use the PopMenu function to display the menu when the user clicks the right mouse button. To achieve this, you need to add a script such as this to the rbuttondown event:

 m_mymdimenu lm_Mlm_M = parent.menuidPopMenu( lm_M.m_menutoshow, w_mdiframe.PointerX(), w_mdiframe.PointerY() )

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist