Print Page | Close Window

Filling two combox boxes with two lists

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=575
Printed Date: 11 December 2024 at 11:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Filling two combox boxes with two lists
Posted By: blockwood
Subject: Filling two combox boxes with two lists
Date 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



Replies:
Posted By: blockwood
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net