Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building a dynamic right-click context menu in excel
I need to build a right-click context menu with the following requirements:
1. It should show up only when my listobject is selected. 2. Depending on the row which is selected in my listobject, some actions may/may not be possilble. I want to only add commandbarbuttons for possible actions. ie, I do not want to add all commandbarbuttons and mark some as disabled, I want to not add the button based on the context 3. On of my commandbarpopups expend into commandbarbuttons that are dynamic based on the row (ie, at coding time, I do not know how many commandbarbuttons there will need to be). I'm generating captions & tags on the fly for this one. 4. For the buttons in (3), the event handlers all point to the same function, but pass different parameters. What is the best way to approach this? Currently, I'm building up the menu on right click, and tearing it down (by unhooking events and calling commandbarcontrol-Delete() on each item I added) after I'm done using it, and it's behaving a little flaky (event handlers getting called multiple times on a single button click) Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building a dynamic right-click context menu in excel
For number 1, you could add your new menu items to the list object right-click shortcut menus...
commandbars 67 "List Range Popup" and commandbars 68 "List Range Layout Popup" and not create a brand new popup -- Jim Cone Portland, Oregon USA "Mareen Philip" wrote in message I need to build a right-click context menu with the following requirements: 1. It should show up only when my listobject is selected. 2. Depending on the row which is selected in my listobject, some actions may/may not be possilble. I want to only add commandbarbuttons for possible actions. ie, I do not want to add all commandbarbuttons and mark some as disabled, I want to not add the button based on the context 3. On of my commandbarpopups expend into commandbarbuttons that are dynamic based on the row (ie, at coding time, I do not know how many commandbarbuttons there will need to be). I'm generating captions & tags on the fly for this one. 4. For the buttons in (3), the event handlers all point to the same function, but pass different parameters. What is the best way to approach this? Currently, I'm building up the menu on right click, and tearing it down (by unhooking events and calling commandbarcontrol-Delete() on each item I added) after I'm done using it, and it's behaving a little flaky (event handlers getting called multiple times on a single button click) Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Screwed Up my Right Click Context Menu, Please Help | Excel Programming | |||
Adding a right-click context menu to Excel VBA TextBoxes | Excel Programming | |||
Undo button in the context menu (right click menu) | Excel Programming | |||
Custom Context menu (Right click menu) not working in sheet changeevent. | Excel Programming | |||
Right-Click (Context Menu) | Excel Programming |