Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Combo/Gallery assign initial value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combo/Gallery assign initial value

 Post Reply Post Reply
Author
Message
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Topic: Combo/Gallery assign initial value
    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

 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2007 at 9:34am
Wonderful. That works!
 
Thanks.
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.063 seconds.