Active4 years, 7 months ago
I would like to use the open file dialog to open a folder path. The standard open folder dialog for VB.NET is more cumbersome to use than the open file style. I know I can select a file in the open file dialog and just grab the folder path. But I feel that is a unnecessary step for my application. Gets or sets the filter string that determines what types of files are displayed from either the OpenFileDialog or SaveFileDialog.
I have two forms named
frmChooseDBase
and frmMain
. frmChooseDBase
is for choosing a file(a database file). Once he's done choosing the database, frmMain
will load the database chosen from frmChooseDBase
.How can I do dat? any help.Here's my sample codes:FvcundoFvcundo
2 Answers
If you just want to load a file, you don't need to make a new form. Just have a button or menu item that says load DB. Clicking that will pop an OpenFileDialog. Drag an openFileDialog control onto the form and give it a meaningful name (openFileDialog1..)
There are plenty of examples for using the openFileDialog control if you get stuck, or need quick help.
MathematsMathemats1,04944 gold badges1818 silver badges3030 bronze badges
hericsonhericson