Hello,
I have the following code in a menu function.
If no fileis clicked (Cancel) it throws an exception.I try to write a
catch try catch statement but opnFile is not visable in the catch
statement I just want to close the dialog box if the user doesnt pick a
file.I thought "Cancel" would just make it go away, but noooo.I will
need "filename" for the next operation if they choose one.
Help Please
OpenFileDialog opnFile = new OpenFileDialog( );
opnFile.Filter = "txt files (*.txt)|*.txt|A ll files
(*.*)|*.*";
opnFile.ShowDia log();
filename = opnFile.FileNam e;
// StreamReader openReader = new
StreamReader(op enStream);
textBox4.Text = File.ReadAllTex t(opnFile.FileN ame);
this.button3.En abled = true;
Thanks
Mike
Comment