Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Can I popup a commandbarpopup at mouse location?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can I popup a commandbarpopup at mouse location?

 Post Reply Post Reply
Author
Message
LeeHayton View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 November 2005
Location: United Kingdom
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote LeeHayton Quote  Post ReplyReply Direct Link To This Post Topic: Can I popup a commandbarpopup at mouse location?
    Posted: 14 November 2008 at 7:15am
I want to click on a control (Calendar day or commandbutton) and display a popup menu with 2 or 3 items on it.  Can I do this using the CommandBarPopup control as opposed to the standard menu that comes with Visual Basic - for 2 reasons - the Codejock commandbar looks nicer and the VB menu causes problems with screen layout of MDI children in my app.
So basically - can you popup a menu (like popupmenu x in VB) with the Codejock commandbar control - if so - how?
 
Thanks
Lee
Back to Top
LeeHayton View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 November 2005
Location: United Kingdom
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote LeeHayton Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2008 at 12:20pm
Forget it - I've worked it out -With a Gallery To Boot.
 
Here's the code if anyone is interested.
 
Thanks
Lee
 
Dim cbSubmissions As CommandBar
Const ID_GallerySubmissionslery_Submissions = 1
Private Sub Form_Load()
Dim cbb As CommandBarButton
With CommandBars1
    .VisualTheme = xtpThemeOffice2007
    .ActiveMenuBar.Delete
    '.AddImageList ImageList1
   
    Set cbSubmissions = .Add("Submissions Popup", xtpBarPopup)
   
    With cbSubmissions
    Dim GallerySubmissions As CommandBarGallery, GallerySubmissionsItems As CommandBarGalleryItems
    Set GallerySubmissions = .Controls.Add(xtpControlGallery, ID_GallerySubmissions, "GallerySubmissionslery")
        GallerySubmissions.ShowBorders = True
        GallerySubmissions.Style = xtpButtonIconAndCaption
        GallerySubmissions.Resizable = xtpAllowResizeHeight
        'GallerySubmissions.Height = 100
       
    Set GallerySubmissionsItems = CommandBars1.CreateGalleryItems(ID_GallerySubmissions)
        GallerySubmissionsItems.ItemWidth = 100
        GallerySubmissionsItems.AddLabel "Submissions"
     
        GallerySubmissionsItems.AddItem 1, "01/01/2008 14:54"
        GallerySubmissionsItems.AddItem 2, "01/01/2008 15:00"
        GallerySubmissionsItems.AddItem 3, "01/01/2008 15:14"
        GallerySubmissionsItems.AddItem 4, "01/01/2008 16:09"
        GallerySubmissionsItems.AddItem 5, "01/01/2008 17:36"
   
    Set GallerySubmissions.Items = GallerySubmissionsItems
       
    End With
End With
End Sub
Private Sub DatePicker1_SelectionChanged()
    Dim Response As Integer
        Response = cbSubmissions.ShowPopup '(TPM_RETURNCMD Or TPM_RECURSE)
End Sub
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.219 seconds.