Print Page | Close Window

Can I popup a commandbarpopup at mouse location?

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=12682
Printed Date: 07 October 2024 at 10:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Can I popup a commandbarpopup at mouse location?
Posted By: LeeHayton
Subject: Can I popup a commandbarpopup at mouse location?
Date 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



Replies:
Posted By: LeeHayton
Date 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



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