I need to place two columns within a single combo box.
But in VB, I found that we can place more than one column in list box by using columns property.
I dont know how to place more than one column in combo box.

Please help me on this.

hi,


U can use the tab or space for more than one column in combo box like this

:idea:
combo1.additem("Apple" & vbtab & vbtab & "Mango")

or


combo1.additem("Apple" space(25-len("Mango")) & "Mango")


best regards
shailu.

Hi,

U can also use a Special NonPrintable Character like:

Combo1.AddItem ("1" & Chr(165) & "One")

When u need to Seperate them, use "Instr" Function

Regards
Veena

Hi,

U can also use a Special NonPrintable Character like:

Combo1.AddItem ("1" & Chr(165) & "One")

When u need to Seperate them, use "Instr" Function

Regards
Veena

hi veena,

:-/
chr(165) = ¥

while using chr(165), it looks some character is added in between two strings. But the requirement is to create two columns in the combo box so space or tab makes as two columns in the combo box.

regards
shailu

Thank you for your suggestions. But a problem is first column char size is 255 and second col char size is 70. So We cant able to see the second column

Hi,

Better use a ListView Control or a MSFlexGrid Control. Users can Alter the ColumnWidth.

Regards
Veena

hi,

I have attached a file with this. Copy the file to ur project and try.

In that file there could be one form and class module.

In that class module there could be a line

ret = ClientToScreen(Form7.Combo3.hwnd, pt)
Form7 - form name
combo3 - combo box name

change it as ur requirement.

while running ur form press the arrow key to view the columns in the combo box

al the best
Shailu

This article has been dead for over six months. Start a new discussion instead.