Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Adding a Combo Box to Command Bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding a Combo Box to Command Bar

 Post Reply Post Reply
Author
Message
shagge22 View Drop Down
Newbie
Newbie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote shagge22 Quote  Post ReplyReply Direct Link To This Post Topic: Adding a Combo Box to Command Bar
    Posted: 01 March 2007 at 11:00am
I am adding a combo box to a command bar. I need to display a text string that is much longer than the size of the combo box. Is there a way to expand the width of the combo box? I am using version 10.3.

Code:
Dim Control As CommandBarControl
Dim PresetBar As CommandBar

Set PresetBar = Cmd_Bar.Add("Preset", xtpBarTop)
    
With PresetBar.Controls
    Set Control = .Add(xtpControlLabel, ID_PRESET_LABEL,
    "Saved Scanner Presets:")
       
    Set Control = .Add(xtpControlComboBox,
    ID_PRESET_COMBO, "No Scanner Presets Available")
    Control.Enabled = True
       
    Set Control = .Add(xtpControlButton,
    ID_PRESET_BUTTON, "")
    Control.Caption = "Set Default"
End With
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2007 at 11:31am
I did the following with a Ribbon.  I'm not sure if it's the 'preferred' method, but it worked.

In General Declarations:

Dim FilterCombo as CommandBarComboBox

In function that creates the ribbonbar:

Dim ControlCombo As CommandBarComboBox

Set ControlCombo = GroupContainer.Add(xtpControlComboBox, ID_FILTERCONTAINERLIST, "Filter")
        ControlCombo.Width = 200
        ControlCombo.DropDownListStyle = False
        ControlCombo.EditHint = "Container Filter..."
        ControlCombo.AddItem "Find Unbilled Containers Due Today"
        ControlCombo.AddItem "Find Unbilled Containers Past Due"
        ControlCombo.AddItem "Find Unbilled Containers Not Past Due"

        Set FilterCombo = ControlCombo

'then use FilterCombo to call events.  You'll have to alter it a bit for 'command bars but I hope this helps.
Back to Top
shagge22 View Drop Down
Newbie
Newbie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote shagge22 Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2007 at 12:20pm
That worked.

Thanks for your help...
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.031 seconds.