Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Creating right click pop menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating right click pop menu

 Post Reply Post Reply
Author
Message
tejsingh View Drop Down
Newbie
Newbie


Joined: 28 March 2007
Location: United Kingdom
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote tejsingh Quote  Post ReplyReply Direct Link To This Post Topic: Creating right click pop menu
    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
Back to Top
joeliner View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 June 2006
Status: Offline
Points: 273
Post Options Post Options   Thanks (0) Thanks(0)   Quote joeliner Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
tejsingh View Drop Down
Newbie
Newbie


Joined: 28 March 2007
Location: United Kingdom
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote tejsingh Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
tejsingh View Drop Down
Newbie
Newbie


Joined: 28 March 2007
Location: United Kingdom
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote tejsingh Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.032 seconds.