Print Page | Close Window

Gallery Item ID

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=8806
Printed Date: 17 June 2025 at 10:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Gallery Item ID
Posted By: LeeHayton
Subject: Gallery Item ID
Date Posted: 16 November 2007 at 10:11am
How do I detect which gallery Item has been clicked?
 
When I run this code It does not display the Gallery Item ID but the ID of the Gallery.
 
Thanks
Lee
 
Private Sub Form_Load()
    Dim ComboPopup As CommandBar, cbp As CommandBarPopup, cbg As CommandBarGallery, cbgis As CommandBarGalleryItems, cbgi As CommandBarGalleryItem
    With CommandBars1
       
        Set cbp = .ActiveMenuBar.Controls.Add(xtpControlPopup, 1, "Add")
       
        Set cbg = cbp.CommandBar.Controls.Add(xtpControlGallery, ID_Garrery, "Gallery")
            cbg.Height = 250
            cbg.Controls.Add xtpControlButton, 1, "Edit List"
            'cbg.CloseSubMenuOnClick = False
           
            Set cbgis = .CreateGalleryItems(ID_Gallery)
                cbgis.ItemWidth = 0
                'cbgis.ItemHeight = 26
               
                'cbgis.AddLabel "Gallery Items"
                cbgis.AddItem 11, "Item 1"
                cbgis.AddItem 12, "Item 2"
                cbgis.AddItem 13, "Item 3"
      
            Set cbg.Items = cbgis
           
    End With
End Sub
 
Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    MsgBox Control.Id
End Sub



Replies:
Posted By: Oleg
Date Posted: 17 November 2007 at 1:01am
Hi,
 
Just pasted from Rbbonsample:
 
         Dim Gallery As CommandBarGallery
            Set Gallery = Control
           
            If Not Gallery.SelectedItem Is Nothing Then
                SelectedStyle = Gallery.SelectedItem.Id
            End If


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: LeeHayton
Date Posted: 19 November 2007 at 4:28am
Thanks - that worked fine.



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