Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Combo Box??!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combo Box??!!

 Post Reply Post Reply
Author
Message
anthony_pacitto View Drop Down
Newbie
Newbie


Joined: 30 July 2010
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote anthony_pacitto Quote  Post ReplyReply Direct Link To This Post Topic: Combo Box??!!
    Posted: 31 July 2010 at 12:30am
Hey, Just wondering...what is the correct code in VB6 to add items to a xtpControlComboBox (ComboBox) that i have located inside my command bar. I need it so that when the form loads it will automatically add items to the combobox...How do i do this! Please help! Thnx.
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 18 August 2010 at 4:20am
Hi,

When setting up a Combobox in the Commandbar use the following code example to add items. There are a few ways in which you can add items...


Dim Combo As XtremeCommandBars.CommandBarComboBox
Set Combo = .Add(xtpControlComboBox, ID_GOES_HERE, "")

' Adding items manually, i.e. a static list of data
With Combo
    .AddItem = "Row 1"
    .AddItem = "Row 2"
End With

' Adding items using a For Loop
For i = 1 To 10
    Combo.AddItem "Item " & i
Next

Dim rs As New ADODB.Recordset
Set rs = cnConn.Execute("SQL Query goes here...")

' Adding items using a Recordset
Do While Not rs.EOF
    Combo.AddItem rs("Value")
    rs.MoveNext
Loop

Hope this helps!

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
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.109 seconds.