Francesco Bonizzi
Francesco Bonizzi

Reputation: 5302

Listbox: add a combobox as Item?

Is it possible to make every item of a listbox as a combobox? I need this because i made the listbox as checkable and then I need to make the user to choose from different options for every element of the list.

Thanks!

Upvotes: 3

Views: 2162

Answers (2)

Siddharth Rout
Siddharth Rout

Reputation: 149297

If you are not planning on distributing your application then you can also look at the TreeView Control. See this example.

CODE

Private Sub CommandButton1_Click()
    With TreeView1.Nodes
        .Add , , "R1", "Root 1"
        .Add "R1", tvwChild, , "Test 1"
        .Add "R1", tvwChild, , "Test 2"
        .Add "R1", tvwChild, , "Test 3"
        .Add "R1", tvwChild, , "Test 4"
        .Add "R1", tvwChild, , "Test 5"

        .Add , , "R2", "Root 2"
        .Add "R2", tvwChild, , "Test 11"
        .Add "R2", tvwChild, , "Test 22"
        .Add "R2", tvwChild, , "Test 33"
        .Add "R2", tvwChild, , "Test 44"
        .Add "R2", tvwChild, , "Test 55"
    End With
End Sub

SNAPSHOT

enter image description here

USING THE CONTROL

To be able to use the Treeview Control, your system must have MSCOMCTL.OCX registered. You can then add the control by Right Clicking on the

SNAPSHOT

enter image description here

DESIGN TIME SNAPSHOT

enter image description here

DOWNLOAD THE OCX

If you do not have the OCX then you can download it from here

Upvotes: 5

iDevlop
iDevlop

Reputation: 25252

You could achieve such an effect by replacing you listbox by a subform in datasheet view.
You will have the mimic the multiselect by providing a checkbox, and you could have a second column as a listbox.

Upvotes: 3

Related Questions