C#以编程方式在OpenFileDialog中突出显示文件 [英] C# programmatically highlight file in OpenFileDialog
本文介绍了C#以编程方式在OpenFileDialog中突出显示文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C#中,一旦在特定目录中打开了OpenFileDialog,我希望能够设置列表中的哪个文件被选中(突出显示),就像单击该文件一样.如果用户碰巧连续多次使用此对话框来选择顺序文件,这将帮助用户记住退出"的位置.
In C#, once an OpenFileDialog is opened in a specific directory, I would like to be able to set which file in the list is selected (highlighted) as though it had been single-clicked. This will help users remember where they "left off" if they happen to use this dialog multiple times in a row to select sequential files.
C#是否提供实现此目的的方法?我需要使用较低级别的构造吗?
Does C# offer a way to do this? Do I need to use a lower-level construct?
推荐答案
您可以简单地设置FileName
属性.
You can simply set the FileName
property.
这篇关于C#以编程方式在OpenFileDialog中突出显示文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文