I have a strange situation where I have an rtf file, that while it opens in word, if I select it in an openfiledialog, then it freezes my .NET app and i have to kill the WINWORD.exe process to regain functionality. This is an issue with the preview pane as when it is hidden, there is no problem.
My call to openfiledialog is bog standard.
using (OpenFileDialog openDialog = new OpenFileDialog() { Title = "Select document...", CheckFileExists = true, Filter = "All files (*.*)|*.*" })
{
if (openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) _FileName = openDialog.FileName;
else return;
}
Other files preview OK, though I anticipate there may be other files may cause a problem, I just haven't found them yet.
As i doubt I can troubleshoot the actual dialog, my workaround is to disable the preview pane - is there any way to do this? of prevent it showing by default?
This is a problem whether the app is run in debug, or standalone.
Use the old Windows 95/98 version of the OpenfileDialog that does not have a Preview pane.
To do this, set the openDialog.AutoUpgradeEnabled
parameter to false
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With