473,396 Members | 1,760 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,396 software developers and data experts.

Directory picker control in .net

Hi All,

I am using visual studio .net with C#. I need to take directory path input
from user. First I thought to use fileopen dialog but that will allow the
user to select files. However, what I want is that user should be able to
pick directories only not files. Any idea how to do that ?

Regards,
Shahzad Atta.
Jul 21 '05 #1
3 4770
If you are using the 1.1 Framework - there's a FolderBrowserDialog.

However the 'easy' way to do this is to use a Treeview to simulate windows
explorer for instance - use the DirectoryInfo class to populate the
directories and the FileInfo class to populate the file information.

This should get you through it
http://www.codeproject.com/csharp/Ad...leExplorer.asp

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Shahzad Atta" <sh*****@nxvt.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi All,

I am using visual studio .net with C#. I need to take directory path input
from user. First I thought to use fileopen dialog but that will allow the
user to select files. However, what I want is that user should be able to
pick directories only not files. Any idea how to do that ?

Regards,
Shahzad Atta.

Jul 21 '05 #2
Shahzad,

When you use Net 1.1 is the easy way to do that is to use the
folderbrowserdialog.

It had a while a bug, however that is gone by the Net 1.1 sp1.

To overcome that bug a lot of people made a treeview, however that is not
needed anymore.

I hope this helps?

Cor
Jul 21 '05 #3
Ryan and Cor thanks a lot!
I do have .Net framework1.1 and I think FolderBrowserDialog is an obvious
choice.

"Shahzad Atta" <sh*****@nxvt.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi All,

I am using visual studio .net with C#. I need to take directory path input
from user. First I thought to use fileopen dialog but that will allow the
user to select files. However, what I want is that user should be able to
pick directories only not files. Any idea how to do that ?

Regards,
Shahzad Atta.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Simon | last post by:
Is there any way that I can use an input with type file as a directory picker? The input starts a file picker but I want to be able to select a folder rather than a file. Thanks IA, Simon
3
by: TD | last post by:
This code doesn't work. Every posting I can find suggests that it should. If TypeOf controlname Is DTPicker then do something here End If I am using the Date Time Picker control and wish to...
6
by: HyperX | last post by:
Is there any way that I can use "OpenFileDialog" as "Directory Picker" rather than file picker or should I write my own damn code in .net??? HyperX.
0
by: Qumer Mumtaz Goraya | last post by:
Hi There is a datatime picker control in one column of my datagrid.When the cell of sepecific column get the focus the datetime picker control appeare It shows the current system date.If once I...
4
by: Rethish | last post by:
Hi All, I am developing an application in VB.net. I am using .Net Datetime picker control to manage the date. But I am not able to assign null/Empty value to the control. I found the property...
4
by: Michel Posseth [MCP] | last post by:
I have a problem with the date time picker validate event wich i believe is a bug How to reproduce : throw on a form a date time picker control and a textbox control select the validating...
5
by: Michel Posseth [MCP] | last post by:
Hello we have encountered the following problems with the date time picker control A : datetime picker control gives focus to last entered field when moving back and forward with focus how do...
0
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the...
1
by: Sabbuser | last post by:
Hey Guys please help me out!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have placed a Date & Time Picker Control on a form in Windows 2000, When our Organization has upgraded all the PC's with...
1
by: sonubaba | last post by:
hello, my question is, in my web application i need datetime picker control in which user can select both date and time from DateTime Picker control i could not find this anywhere on inter net ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.