borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (saving files)Next Topic (Is It Possible) New Topic New Poll Post Reply
AndreaVB Forum : VB General : two columns in Combo Box
Poster Message
shahidmojid
Level: Professor

Registered: 09-05-2002
Posts: 85

icon two columns in Combo Box   Archived to Disk

Hi all,

Can someone tell me, how to show two columns in a combo box?
Please help!

10-07-2002 at 09:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: two columns in Combo Box   Archived to Disk

As far as I know, It's not possible. [May be some API with subclassing that could do it, but then I'd think it'd resemble a listbox more than a combo box.]

You could always create your own custom control, or just put two combo boxes one for the first col, one second.

10-07-2002 at 09:55 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
shahidmojid
Level: Professor

Registered: 09-05-2002
Posts: 85
icon Re: two columns in Combo Box   Archived to Disk

Thanks JL. You saved my time.

Bye the way, can you please tell me how to add 4 colums in a list box and add data into it?

Me.List1.Columns = 4
Me.List1.AddItem rst![name], 0

but how can i write to the second column. Please help.

11-07-2002 at 08:26 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: two columns in Combo Box   Archived to Disk

As far as I know, it too isn't possible (directly, like by an option). The only way to on pursose put it in a different column is to add a "blank" in the list (add " "). Then you'd have to test for your "blank" spot since the control assumes it to be a valid entry.

It only uses the columns if the items in the list couldn't be shown without a vertical scroll bar.

IE: If you have a listbox, 4 items tall with 8 items, for 1 col, it'd have a list with a scrollbar. 2 cols, it'd have two columns with 4 per col.

Offhand, you may have better use from a Grid (Flex grid), it'd allow you to put info into any column you want, although it may not be feasible in your situation.

11-07-2002 at 05:51 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
shahidmojid
Level: Professor

Registered: 09-05-2002
Posts: 85
icon Re: two columns in Combo Box   Archived to Disk

Thanks a lot JL for all of ur help. You are so helpful.

Thanks

11-07-2002 at 06:58 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : two columns in Combo Box
Previous Topic (saving files)Next Topic (Is It Possible) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder