Multi Column Combox (1 Viewer)

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
Does anybody know how to get multi columns in combo box ? I search on the net but so far no answer. There was one that had the code, but it did not explain as to how to compile the code and using in the program. I have also saw a video on youtube that had a DLL file, but it does show where to get not ? Does any body has any suggestions ?



Thank you
 

moke123

AWF VIP
Joined
Jan 11, 2013
Messages
1,060
or have you tried adjusting the column counts and column widths?
0 width will hide a column and anything else (>0) will show it.
 

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
By wizard do you mean the toolbox ? Thanks for the suggestion, but my problem not in creating combo box but with the columns that the combo box will have. The comb box has only have one column and I it did to have more then on like in Access. I have seen a sample where they put data in single column and use "|" as divider for the data, but is it still one column and the when data is extracted form the database and loading into the combo box it will be messy because it goes into only column and only one line is used to load the data into the combo box.
 

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
monke123,


In Vb.net there column count like in Access, at least I did not see one that is part of the problem with the combo box in Vb.net has only one column.
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,329
Open the form in design view & select the combo.
Now go to the Format tab on the property sheet and change the column count & column widths as suggested above



EDIT:
Oops - sorry - the above is for Access not VB.Net. Do you have something similar?
 

Attachments

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
isladogs,

Thank you for for the suggest, but the photo is for Msaccess. I need the one for Vb.net. Perhaps I have posted the question in the wrong forum.


Thank you
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,329
No it was my error. Realised immediately i'd posted. See comment below the screenshot.
 

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
Re: Multi Column Combox - Changing text in combo box

For moment I am doing a working around the issue by using a "|" between items to divide the single column into multiple columns. When I did this I ran into the issue that when the item is selected the whole column is displayed on the text box when I only need first column. I used the 10 bytes for the first column and I able to extract the data by I can not seem to put this value into the combo box text value. I have tried it various events of the combo box, but no luck so far. Below is an example of the the items in the drop down look like.



Bundy | AL
Dylan | Bob
Bean | Mr.


When I select an item for Example Bundy | AL, I want only Bundy to appear on the Combo box text as the select item, not Bundy| AL. The reason that I want this is because I will searching in the database for that field base on the text of that field.


Does anybody know to fix this problem ?
 

Ryobi

Registered User
Joined
Mar 5, 2012
Messages
49
Yes, that is what I exactly what I need. I will tried it latter tonight when I get home. Thank you,
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom