Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Add items to combobox?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add items to combobox?

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


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post Topic: Add items to combobox?
    Posted: 30 April 2004 at 4:18pm

Hi,

I load an XCB file which has a toolbar with a combobox.

How do I add items to this combobox in vb code?

 

 

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 11:00am

Take a look at DynamicPopups sample. CommandBars_InitCommandsPopup procedure. Use AddItem method of CommandBarComboBox object. You may have to use .FindControl  method of CommandBars to find your CommandBarComboBox object.

Set ControlComboBox = CommandBar.FindControl(, Id, , True)

ControlComboBox.AddItem itemText

Good luck

 

 

Back to Top
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 11:21am

Thanks, but in this case the items are only added when someone clicks on the combobox?

I need to add items (in this case cd devices) into the combobox without any user interaction, and the first item (device) should be displayed.

 

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 11:26am

Right,

So in form_load or whatever:

Dim ControlComboBox as CommandBarComboBox

Set ControlComboBox = CommandBar.FindControl(,Id,,True)

If not ControlComboBox is nothing then

    ContgrolComboBox.AddItem itemText

End if

Something like that.

Back to Top
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 11:34am

That did the trick!

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.172 seconds.