Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Filling two combox boxes with two lists
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Filling two combox boxes with two lists

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


Joined: 23 March 2004
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote blockwood Quote  Post ReplyReply Direct Link To This Post Topic: Filling two combox boxes with two lists
    Posted: 27 March 2004 at 8:29pm
I have the code to fill comboboxes with a list and it works great.

But if you have two combo boxes i can't work with them in a granular way. is there a way to explicitly reference one combo box - fill it with a list, and then reference the next and fill it with a different list?

this code:

    If ICmdBar.Position = xtpBarListBox Then
        If (Not ICmdBar.Parent Is Nothing) And (ICmdBar.Parent.Type = xtpControlComboBox) Then

             Set ControlComboBox = ICmdBar.Parent    'return ComboBox control

             strText = ControlComboBox.Text      &nbs p;   'store current text
             ControlComboBox.Clear

             For i = 0 To cmbCommands.ListCount - 1
                ControlComboBox.AddItem cmbCommands.List(i)
             Next

             IndexCurrent = ControlComboBox.FindItem(strText)
             If (IndexCurrent > 0) Then ControlComboBox.ListIndex = IndexCurrent 'restore curretn text

        End If
    End If

references and populates the "Parent" - i need the specific control like it does for filemenu and the button - drop down. it seems as if combo box is populated differently.

TIA
Back to Top
blockwood View Drop Down
Groupie
Groupie


Joined: 23 March 2004
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote blockwood Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2004 at 8:41pm
got it. added 2 combo boxes (cmbCommands and cmbCommands2) and reference them via ID property        &nbs p;   

If ControlComboBox.Id = ID_MASTER_SERVER Then
                Set cbo = cmbCommands
             Else
                Set cbo = cmbCommands2
             End If
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.188 seconds.