Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

[Zikani]

  • 3 years ago

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

  • This Question is Closed
  1. scign
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  2. [Zikani]
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.