PDA

Click to See Complete Forum and Search --> : Multi Column Listbox


Alan OKeeffe
Aug 23rd, 2000, 12:46 PM
I want to use a multi column (db)listbox/ Combo Box as with Access 2000.
Part Number and Description in two columns in a VB listbox/Combo box.
I have got around it by using a query which combines both fields and spaces between based on the length of the part number. Only annoying thing with this method is that it requires fixed size fonts to line up correctly.
Can I add in the Access 2000 component, or any other way. Any ideas?

Regards

Alan.



[Edited by Alan O'Keeffe on 08-23-2000 at 03:17 PM]

parksie
Aug 23rd, 2000, 01:00 PM
How about using the ListView control?

Alan OKeeffe
Aug 23rd, 2000, 02:23 PM
That's an idea but the original Access program uses drop down combos which I'm trying to replicate, also the listview can't be bound.

Thanks for the help anyway.

Alan

parksie
Aug 23rd, 2000, 02:38 PM
Ah...I see. I think MSDN has some info on customising the Combo Boxes. Look under the Platform SDK.

davidrobin
Aug 23rd, 2000, 05:00 PM
I am at home at the moment so can't test this but have you tried adding a tab character instead of spaces. I think there should be a constant declared for it something like vbTab. Or using the CHR() function. The other option I suppose is to use a bound datagrid with 2 columns.

Alan OKeeffe
Aug 23rd, 2000, 06:45 PM
Hi David,

VBtab and chr$(9) act like a group of spaces, about 6. This has the same effect as space$(6). The only way around it is to use courier or terminal font.

The dataGrid won't act as a dropdown combo.

If you look at Access 2000 you can set the columns in
the listbox and the combobox, then fill the columns individually.

Any ideas about added this component into VB?

Thanks for your ideas,

Alan.

jason1972
Aug 24th, 2000, 10:01 PM
Hi David,

I had the same problem when I first moved from Access to VB. It was extremely frustrating to find out that VB, unlike Access, does not provide multicolumn combo boxes, multicolumn listboxes, and drop down lists for grid cells. Instead of struggling with VB's primitive controls =), I took the easy way out and tried 3rd party ActiveX controls like APEX True DBList and Sheridan DataWidgets. I am currently using the APEX control.

jason1972
Aug 24th, 2000, 10:03 PM
Sorry. My previous post was supposed to be addressed to Alan, not David.

jason1972
Aug 24th, 2000, 11:40 PM
I just read a suggestion in another forum. Add Microsoft Forms 2.0 Object Library to your components. The combo box and list box included supports multiple columns. I think these are the standard controls of Visual FoxPro. (How come they have better controls than we do???)

Alan OKeeffe
Aug 25th, 2000, 04:49 AM
That's it, Jason.

MicroSoft Forms has a listbox and combobox that support multi columns. Just tested it, seems to work fine.

Thanks for the help.

Alan.