Simple "Browse for a file" control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I apologize that I am new to windows forms programming. I'm looking for the
correct control or components to use to create standard browse-for-a-file
capability. I'd like to have a textbox and a button next to it that says
"Browse". When you click the browse button you would get the standard
windows api dialog that allows you to browse for a particular file. When the
user finds his/her file, they would select it and the textbox would be
populated with their selection.

This is very easy to do with web / html controls, but I've never had to do
it in a windows form unfortunately. I've done a bit of googling and I'm
getting results for a lot of custom / enhanced solutions. I'm looking for a
simple example. If anyone could please provide some direction I'd greatly
appreciate it.
 
Hi

In your Button event create an OpenFileDialog and use its ShowDialog method. There is also the SaveFileDialog.
 
Also, all these "common dialogs" are there in the .NET Toolbox. You can
directly add them to your form from there, as well.

Regards,

Cerebrus.
 
Back
Top