473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

List of Folders

Is there a way to list only the folders of a certain path in a List box? If so...how do I go about doing that.

What I want to do is list all the folders in C:\Folder1\ and Display the Names of the Folders in a List Box

Thank you in advance
Aug 17 '06 #1
2 3329
BSOB
77
not exactly a text box, but there is a directory object.

The "Directory List Box" is a tool on the standard toolbox. 8th from the top, left side, with the image of a windows folder.

private sub form_load()
Dir1.Path = "C:\folder1\"
end sub

if you need to have it in a list box, (be ware, there are better ways then what i have here), then you can try the following code:

'(have your dir1.visible = false)
private sub form_load()
Dir1.Path = "C:\folder1\"
Dim x as integer
For x = 0 To Dir1.ListCount - 1
list1.AddItem (Dir1.List(x))
Next x
end sub

'that works.. but not the best way. im sure. also, your output will list the folder names with the path before them. you can do some string manipulation on your own to remove the path. if you want help with that, im game.
Aug 18 '06 #2
Hemant Pathak
92 Expert
Hi...........
if u want to using the File and Folder to better way then u can use these Controls
1. Drive Control
2. Dir Control
3. File Control

Thanks.....
Aug 23 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Konrad L. M. Rudolph | last post by:
I hope this is the right NG, please notify me if not. I have got a problem with the "recent files" list of the start page in VS.NET: yesterday I created a new projekt which has the same name as...
6
by: Dave Hopper | last post by:
Hi I am using the following SQL to retrieve a value in a list box using a unique ID held in the list box call cntID. The list box is used on an order form to list appointments that have been...
7
by: Dave Hopper | last post by:
Hi I posted a question recently regarding problems I am having getting a value from a list box to use in a query. I got a lot of help, for which I thank you and it's nearly working! But I need...
3
by: sva | last post by:
Using C# for an application in which I am working on, I need to display the available shared folders on the computer that's running the application. The shared folder paths need to be in UNC format...
1
by: lecnac | last post by:
Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group The...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
0
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As...
8
by: 7effrey | last post by:
Hi Does anyone know how to make a script that list the folders in a specific directory, but when the list is made it must be possible to click on it like a link so people can be redirected, but...
2
by: Mike P | last post by:
I need to find all the folders at a certain location, and then once I have this list of folders I need to add some of them to a collection and then show the names of those folders on screen (there...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.