Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, Is it possible to have a right click menu display when you right clic on an object such as a VB combobox? I can get the menu to appear whe right clicking on a cell but not on a combobox. Dim NewControl As CommandBarControl Set NewControl = Application.CommandBars("cell").Controls.Add With NewControl .Caption = "Clear Combo" .OnAction = "Clear" .BeginGroup = True End With Many thank -- cmpcwil ----------------------------------------------------------------------- cmpcwil2's Profile: http://www.excelforum.com/member.php...fo&userid=3341 View this thread: http://www.excelforum.com/showthread.php?threadid=55025 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single) Upon right-click, you can show your own popup menu HTH -- AP "cmpcwil2" a écrit dans le message de news: ... Hi, Is it possible to have a right click menu display when you right click on an object such as a VB combobox? I can get the menu to appear when right clicking on a cell but not on a combobox. Dim NewControl As CommandBarControl Set NewControl = Application.CommandBars("cell").Controls.Add With NewControl Caption = "Clear Combo" OnAction = "Clear" BeginGroup = True End With Many thanks -- cmpcwil2 ------------------------------------------------------------------------ cmpcwil2's Profile: http://www.excelforum.com/member.php...o&userid=33411 View this thread: http://www.excelforum.com/showthread...hreadid=550257 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you thats great, don't why I didn't try that! Thanks agai -- cmpcwil ----------------------------------------------------------------------- cmpcwil2's Profile: http://www.excelforum.com/member.php...fo&userid=3341 View this thread: http://www.excelforum.com/showthread.php?threadid=55025 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a context menu to appear upon a right click of the mouse whilst on a combo box. However the menu appears twice once when you right click and then again upon selection of a menu item, I have implemented the code above in a class module so not sure if this is the problem, here is my code: set up menu in module: Dim NewControl As CommandBarControl Set NewControl = Application.CommandBars("cell").Controls.Add With NewControl ..Caption = "Clear Combo" ..BeginGroup = True End With call the menu from class module depending upon which combo box has focus: Sub ComboGroup_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button = 2 Then CommandBars("cell").ShowPopup ComboGroup.Text = "" ComboGroup.clear End If End Sub Can anyone help me on this? thanks -- cmpcwil2 ------------------------------------------------------------------------ cmpcwil2's Profile: http://www.excelforum.com/member.php...o&userid=33411 View this thread: http://www.excelforum.com/showthread...hreadid=550257 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add items to context menu | Excel Worksheet Functions | |||
Context menu of Cell | Excel Programming | |||
Context Menu | Excel Programming | |||
Context menu on userform | Excel Programming | |||
context menu | Excel Programming |