本文介绍了默认名的OpenFileDialog C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置的默认文件名是answer_XXXXXX.csv在打开文件对话框。但它显示是这样的。默认名称answer_XXXXXX.csv不显示完整。

I set the default file name is answer_XXXXXX.csv in OpenFileDialog. But it displays like this. The default name "answer_XXXXXX.csv" isn't displayed full.

然后我点击文件名组合框。它显示正是

Then I click on File name combo box. It displays exactly

我怎样才能解决这个问题?

How can I fix it?

感谢。

推荐答案

有是这个小的解决方法。 。看看下面一行调用的ShowDialog()之前

There is a small workaround for this. Have below line before calling ShowDialog().

    openfiledialog.ShowHelp = true;



例如:

Example:

OpenFileDialog openfiledialog = new OpenFileDialog();
    openfiledialog.ShowHelp = true;
    openfiledialog.FileName = "answer_XXXXXXX.csv";
    openfiledialog.ShowDialog();

有关更多:

这篇关于默认名的OpenFileDialog C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:34
查看更多