-
September 1st, 2009, 07:01 AM
#1
Passing file to ComboBox
Hello All,
I am new to VB environment. I am using Visual Studio 2005.
In certain code, I need to add 4000 elements to the ComboBox list.
Using the command
ComboBox1.Items.Add()
seems ridiculous.
I am thinking of creating EXCEL File, in which I will put all the names in 1 column and call that excel File, when "dropdown" of combo box is clicked.
Can Anybody tell me, how this will happen??
Any code related to this? or if this issue has already been discussed then plz give me the link for the same
If this is not good idea like putting 4000 elements, then can there be any other solution?
-
September 1st, 2009, 08:03 AM
#2
Re: Passing file to ComboBox
Hi!
Instead of using an Exce lfile ( which will incur additional overhead ), why not make use of a Text file instead ¿
Yes, this is possible, but is it really viable ¿ Is there any particular reason why there is so many items ( 4000 ), isn't there a way of separating / organizing these items a bit better ¿
-
September 1st, 2009, 08:11 AM
#3
Re: Passing file to ComboBox
4000 elements is a bit much for a combo box, could be very difficult to find the item one is looking for. I definitely would not use Excel. A database maybe but Excel no way.
As for adding the items to a combo you would use the .items.add(), Ideally you would load the data from a text file or database and use the .items.add() in a loop but again 4000 items is a bit much to wade through in a combo.
-
September 1st, 2009, 07:30 PM
#4
Re: Passing file to ComboBox
No, over 25 is a bit much. 4000 is ridiculous. Who would expect a user to read thru half of those, looking for the right choice?
-
September 3rd, 2009, 11:22 PM
#5
Re: Passing file to ComboBox
Thank you for replies.
Definitely.......I am searching for an alternative to this.
I am thinking of one but dont know this will work with VB or not......plz let me know.....
the search engine will work with the combo box.....
for ex....if user types........DLF........and the same name exists in database.........it will directly move to another window...........but if instead someone types......DL or DF........the search engine will run and search for nearest possible words present in the database. these names will then be displayed to user.
Is this possible in VB? If yes.....any hint??
-
September 4th, 2009, 12:34 AM
#6
Re: Passing file to ComboBox
Sure. Start with a BLANK combo. As soon as he types one letter, show the first 25 entries. With the second, the first 25 that match. Etc...
Doesn't matter if you load the first 25 in the beginning. Just don't try to load and index 4000 at once
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|