Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

VB.NET : how do i get a combobox to load its info frm file names in a specified directory?

OpenStudy (scign):

The "Dir" function returns the contents of a specific directory. You call the function once with the directory name and relevant options, and it gives you the first one. Calling the function again with no parameters several times gives you the rest one by one and returns "" when there are no more. Make sure you have the slash at the end of the first call if you're only specifying the directory. You can also use wildcard characters (* and ?) to filter the results. So you need a loop. Set up a 'while' loop to read in all the files until you get a "" and as you get them, add them to the combobox. filename = Dir("C:\Directory\") ' set up the iteration Do While filename <> "" ' when filename is empty we're done Combo1.AddItem filename ' add the file to the combo box filename = Dir() ' get the next one - will return empty when finished Loop

OpenStudy (anonymous):

thanks...i tried it and posted it on DaniWeb.... http://www.daniweb.com/software-development/vbnet/threads/376595

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!