good way to open a file with the OpenFileDialogue in Visual Basic.NET 2005 Express

I have made a program with a MDI that can edit text documents. However I cannot open files. My saving function works fine. Could someone please tell me a good way to open a file with the OpenFileDialogue in Visual Basic.NET 2005 Express Edition and give me some sample code?

Thanks in advance!

[302 byte] By [JasonD] at [2007-12-16]
# 1

1_Below is the code in C# , you can easily change it to VB
2_C# is a more respected language than VB, so move away from VB and get your language right from the begining.

OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Access DataBase Files (*.mdb)|*.mdb|All files (*.*)|*.*";
openFileDialog1.FilterIndex = 1;
openFileDialog1.RestoreDirectory =
true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//Do what you need to do the file by using openFileDialog1.FileName e.g. next line
Access
.FullPathToDB = openFileDialog1.FileName;
}

Regards

XGR131 at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
How do I convert C# to VB.NET 2005?
JasonD at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
it is not possible directly. u have to do it manually or try some 3rd party tools.
MuthuKrishnan.R at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
You dont need a 3rd paty tool to convcert that to VB.
Use your mind that is the best tool you have, there is hardly anything in the C# code that you already dont know in VB.
Sorry to hear you want to change C# to VB, here is how to use OpenFileDialog VB code included

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsOpenFileDialogClassTopic.asp

Regards

XGR131 at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5

Hey don't worry, Thanks for the code... lol I just used SharpDevelop to convert the code.

I can also change VB.NET to C#.NET and vice versa... Handy... Now I need to find some online books to help me code in C#...

JasonD at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...