Print Page | Close Window

Combo/Gallery assign initial value

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


Topic: Combo/Gallery assign initial value
Posted By: indices
Subject: Combo/Gallery assign initial value
Date Posted: 01 November 2007 at 10:32pm

I am trying to create a combo box which popups up a gallery instead of the dropdown. How can I assign initial combo box text or listindex value. I don't want to enable DropDownListStyle=True since the user has to choice one of the choices from the gallery rather than type in some value.   

    Dim oCmbAnnotationPopup As XtremeCommandBars.CommandBar
    Dim GalleryMode As XtremeCommandBars.CommandBarGallery
    Dim ItemsMode As XtremeCommandBars.CommandBarGalleryItems
    Dim oCmbMode As XtremeCommandBars.CommandBarComboBox

    Set ItemsMode = CommandBars.CreateGalleryItems(ID_AUTO_MODE)
    ItemsMode.Icons = Me.ImageManagerAnnotations.Icons
    ItemsMode.ItemWidth = 160
    ItemsMode.ItemHeight = 50

    ItemsMode.AddItem 7000, "First"
    ItemsMode.AddItem 7001, "Second"
    ItemsMode.AddItem 7002, "Third"
   
    Set oCmbMode = GroupAnnotations.Add(xtpControlComboBox, ID_AUTO_MODE, "")
    Set oCtlCmbAnnotationMode = oCmbMode
    oCmbMode.Width = 125
    
    Set oCmbAnnotationPopup = CommandBars.Add("Combo Popup", xtpBarComboBoxGalleryPopup)

    Set GalleryMode = oCmbAnnotationPopup.Controls.Add(xtpControlGallery, ID_AUTO_MODE, "")
    GalleryMode.Width = 160
    GalleryMode.Height = 100
    GalleryMode.Style = xtpButtonIconAndCaption
    GalleryMode.ShowScrollbar = False
    Set GalleryMode.Items = ItemsMode

    Set oCmbMode.CommandBar = oCmbAnnotationPopup

 



Replies:
Posted By: Oleg
Date Posted: 02 November 2007 at 2:10am
Hi,
 
You have add update handler for ID_AUTO_MODE combo and CurrentComboIndex variable.
 
Case  ID_AUTO_MODE:
            If (Control.Type = xtpControlComboBox) Then
                Control.ListIndex = CurrentComboIndex
            End If


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


Posted By: indices
Date Posted: 02 November 2007 at 9:34am
Wonderful. That works!
 
Thanks.



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