C# · 12月 27, 2021

OpenFileDialog C#的默认名称?

我在OpenFileDialog中设置了默认的文件名为answer_XXXXXX.csv.但它显示如下.默认名称“answer_XXXXXX.csv”不显示完整.

然后单击文件名组合框.它正好显示

我该如何解决?

提前致谢.

解决方法 这有一个小的解决方法.在调用ShowDialog()之前有下面的行. openfiledialog.ShowHelp = true;

例:

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

更多:

@L_403_0@