Print Page | Close Window

Creating right click pop menu

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=6838
Printed Date: 19 June 2025 at 1:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Creating right click pop menu
Posted By: tejsingh
Subject: Creating right click pop menu
Date Posted: 11 April 2007 at 9:30am
Hi

I am new to all this

just wondering can anyone assist me with this.

I have created a calendar and on events when i right click i want a popup menu to appear similar to the one in outlook

i have looked at examples but no joy

any advice would be much appreciated

TJ



Replies:
Posted By: joeliner
Date Posted: 11 April 2007 at 9:55am
Try this TJ..

Private Sub CalendarControl_ContextMenu(ByVal x As Single, ByVal y As Single)
Dim PopupBar As CommandBar, Control As CommandBarControl

    Debug.Print "On context menu"
   
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = CalendarControl.ActiveView.HitTest
   
    If Not HitTest.ViewEvent Is Nothing Then
        Set ContextEvent = HitTest.ViewEvent.Event
             
            ZOrder
            Set PopupBar = CommandBars.Add("Popup", xtpBarPopup)
            With PopupBar.Controls
            .Add xtpControlButton, 1, "&Open Event"
            .Add xtpControlButton, 2, "&Delete Event"
             .
             .  
             .
            End With
            PopupBar.ShowPopup
   
    End If



Posted By: tejsingh
Date Posted: 11 April 2007 at 10:17am
Cheers for that!

I have adapted what you posted into my calendar_Mousedown procedure.

And it works a treat cheers!

Just need to get it work when it finds an event. I am creating a com object which is embedded into my progress 4gl program.

I have another problem which is i have created the command bar on screen but when i open the object it displays the command bar at the top of the screen. But i can move it around the screen.

Can this be disabled??

TJ




Posted By: tejsingh
Date Posted: 11 April 2007 at 11:56am
To add to the above i have another issue:

What i want to do is to have a procedure which will return the item selected from the popup menu is that possible?



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