G
Guest
I need to use the OpenFileDialog class to get the name of a file, but I don't
want it to check to see if the file is really there since I may just want to
type an arbitrary name in and create it later. I assume the correct way to
do this is to handle the OK button click event. I found the following
example code but the OK button still doesn't seem to go to my event handler.
Any ideas? Thanks, Ray.
OpenFileDialog openLogFileDialog;
private void GetLogFileName()
{
openLogFileDialog = new OpenFileDialog();
openLogFileDialog.ShowDialog();
}
private void openLogFileDialog_FileOk(object sender,
System.ComponentModel.CancelEventArgs e)
{
// handle the file name in openLogFileDialog.FileName
}
want it to check to see if the file is really there since I may just want to
type an arbitrary name in and create it later. I assume the correct way to
do this is to handle the OK button click event. I found the following
example code but the OK button still doesn't seem to go to my event handler.
Any ideas? Thanks, Ray.
OpenFileDialog openLogFileDialog;
private void GetLogFileName()
{
openLogFileDialog = new OpenFileDialog();
openLogFileDialog.ShowDialog();
}
private void openLogFileDialog_FileOk(object sender,
System.ComponentModel.CancelEventArgs e)
{
// handle the file name in openLogFileDialog.FileName
}