Can I popup a commandbarpopup at mouse location? |
Post Reply |
Author | |
LeeHayton
Senior Member Joined: 25 November 2005 Location: United Kingdom Status: Offline Points: 102 |
Post Options
Thanks(0)
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
|
|
LeeHayton
Senior Member Joined: 25 November 2005 Location: United Kingdom Status: Offline Points: 102 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |