ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Right-click Combo Event (https://www.excelbanter.com/excel-programming/340458-right-click-combo-event.html)

John[_88_]

Right-click Combo Event
 
Hi there,

I'd like to add a right click context menu ("Delete selected item") to a
combobox so that I can right click on an item and remove it from the
combobox's source range and the combobox itself.

I'm happy with the remove code, but would appreciate help with the right
click event.

Thanks in advance

John



Tom Ogilvy

Right-click Combo Event
 
Seems like you would use the mousedown event and look at the button argument
to see if it is a right click.

You could then have the code position a commandbutton or label next to the
combobox.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Hi there,

I'd like to add a right click context menu ("Delete selected item") to a
combobox so that I can right click on an item and remove it from the
combobox's source range and the combobox itself.

I'm happy with the remove code, but would appreciate help with the right
click event.

Thanks in advance

John





John[_88_]

Right-click Combo Event
 
Perfect. Thanks Tom.

In the end I just used a YesNo MsgBox having got the list item from your
MouseDown event.

Thanks again

John


"Tom Ogilvy" wrote in message
...
Seems like you would use the mousedown event and look at the button
argument
to see if it is a right click.

You could then have the code position a commandbutton or label next to the
combobox.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Hi there,

I'd like to add a right click context menu ("Delete selected item") to a
combobox so that I can right click on an item and remove it from the
combobox's source range and the combobox itself.

I'm happy with the remove code, but would appreciate help with the right
click event.

Thanks in advance

John








All times are GMT +1. The time now is 04:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com