Print Page | Close Window

How Do I Right Click a menu item & get a popupmenu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5437
Printed Date: 26 April 2025 at 1:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How Do I Right Click a menu item & get a popupmenu
Posted By: LeeHayton
Subject: How Do I Right Click a menu item & get a popupmenu
Date Posted: 06 November 2006 at 6:10am
I want to add the functionality to rename and delete items from a menu and so I need to know how to show a popupmenu when right clicking a menu item AND STILL have the menu visible behind the popupmenu.
 
Using the ControlRButtonUp display the popupmenu but hides the original menu control - in effect i need a ControlRButtonDOWN
 
Any ideas?
 
Thanks



Replies:
Posted By: Oleg
Date Posted: 06 November 2006 at 6:23am
Hello,
 
Catch
Private Sub CommandBars_ToolBarContextMenu(ByVal ToolBar As XtremeCommandBars.ICommandBar, ByVal ContextMenu As XtremeCommandBars.ICommandBar)
event


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: LeeHayton
Date Posted: 06 November 2006 at 6:37am
Thanks - but I don't think that fires on a right click of a menu item.


Posted By: LeeHayton
Date Posted: 06 November 2006 at 6:42am
I need to have a popup menu at this level.
 
 


Posted By: Oleg
Date Posted: 06 November 2006 at 7:14am
Oh. see now.
 
you need TPM_RETURNCMD Or TPM_RECURSE flags:
 
Private Sub CommandBars_ControlRButtonUp(ByVal Control As XtremeCommandBars.ICommandBarControl)
    If (Control.Id = ID_FILE_NEW) Then
        Dim Popup As CommandBar
        Dim Cmd As Integer
          
        Set Popup = CommandBars.Add("Popup", xtpBarPopup)
        With Popup.Controls
            .Add xtpControlButton, ID_EDIT_COPY, "&Copy", -1, False
            .Add xtpControlButton, ID_EDIT_PASTE, "&Paste", -1, False
        End With
   
        Cmd = Popup.ShowPopup(TPM_RETURNCMD Or TPM_RECURSE)

    End If
End Sub



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: LeeHayton
Date Posted: 06 November 2006 at 7:19am
Works a treat! Thanks.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net