|  | 
| Add items to combobox? | 
| Post Reply   | 
| Author | |
| rdeboer   Groupie   Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |  Post Options  Thanks(0)  Quote  Reply  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? 
 
 | |
|  | |
| robs   Groupie   Joined: 09 November 2003 Status: Offline Points: 84 |  Post Options  Thanks(0)  Quote  Reply  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 
 
 | |
|  | |
| rdeboer   Groupie   Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |  Post Options  Thanks(0)  Quote  Reply  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. 
 | |
|  | |
| robs   Groupie   Joined: 09 November 2003 Status: Offline Points: 84 |  Post Options  Thanks(0)  Quote  Reply  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. | |
|  | |
| rdeboer   Groupie   Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |  Post Options  Thanks(0)  Quote  Reply  Posted: 01 May 2004 at 11:34am | 
| That did the trick! Thanks! 
 | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |