OpenFileDialog short question

  • Thread starter Thread starter Josema
  • Start date Start date
J

Josema

Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.
 
Josema,

The file dialog doesn't perform any kind of file operations, it just
selects a file. Is it possible that you are performing some sort of
operation before the file dialog closes?
 
In the event File_Ok of the openfile dialog, i open a word
file and make some operations, this fact makes that the
dialog remains opened for a 30 seconds if the word file
has more than 2 pages aprox...

Josema
-----Original Message-----
Josema,

The file dialog doesn't perform any kind of file operations, it just
selects a file. Is it possible that you are performing some sort of
operation before the file dialog closes?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.


.
 
Why is it in the File OK event?

It's not really good to open anything at the file dialog stage, because as
it's been mentioned, this should be for "selecting files" only.

Are you sure you need to be overriding the file dialog class in the first
place?

Normal procedure is as follows:

OpenFileDialog openDlg = new OpenFileDialog();
if ( openDlg.ShowDialog () == DialogResult.OK )
{
// get your file name here and perform operations to it
}

this way the dialog closes then the operations are performed.

hope that helps.
Dan.

In the event File_Ok of the openfile dialog, i open a word
file and make some operations, this fact makes that the
dialog remains opened for a 30 seconds if the word file
has more than 2 pages aprox...

Josema
-----Original Message-----
Josema,

The file dialog doesn't perform any kind of file operations, it just
selects a file. Is it possible that you are performing some sort of
operation before the file dialog closes?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.


.
 
Back
Top