默认名的OpenFileDialog C#? [英] Default name with OpenFileDialog C#?

查看:131
本文介绍了默认名的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();

有关更多:

http://connect.microsoft。 COM /的VisualStudio /反馈/信息/ 525070 /打开文件对话框出现,部分的文件名,在WIN7

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆