File explorer tool in Visual Studio?

14,599

Solution 1

It's not that easy. You want the file open dialog. You would have to add a button, then in the handler for the button open the dialog.

OpenFileDialog fdlg = new OpenFileDialog();
if(fdlg.ShowDialog() == DialogResult.OK)
{
// do something here with fdlg.FileName ;
}

source

Solution 2

It's the Dialogs section. Look for the OpenFileDialog or one of the others (according to your needs)

enter image description here

Share:
14,599
Ayub
Author by

Ayub

Updated on June 07, 2022

Comments

  • Ayub
    Ayub almost 2 years

    I have a C# project using windows forms. I need to let the user enter the location of a text file, so they will need some way to browse files and folders i.e. a button that opens a file explorer. What tool (in the toolbox) would this be in Visual Studio 2010? I tried DirectoryEntry and DirectorySearcher but that just adds something to the bottom like this:

    enter image description here