1
Reply

File I/O;OpenFileDialog

azbird

azbird

Nov 28 2004 6:48 PM
1.8k
I have a browse button that successfully allows a user to navigate to a text file: OpenFileDialog openDialog = new OpenFileDialog(); openDialog.InitialDirectory = bFile; openDialog.FileName = bFile; openDialog.Filter = "All files (*.*)|*.*|All files (*.*)|*.*" ; bfile is a class module string variable that holds a valid path (ie: C:\FileName.txt). An existing file is hi-lighted and the 'file name' and 'files of type' boxes are filled with the correct file information. However, when the 'Open' button is clicked, the open file dialog closes and reveals my windows form. Notepad doesn't open and therefore the text file never opens. Any ideas? What am I missing here?

Answers (1)