473,394 Members | 1,755 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,394 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 4769
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.