如何从按钮单击获取文件路径并将其打印在文本框VB6上
我有一个按钮和一个文本框,我想让按钮通过默认路径打开文件夹。
我将举一个例子:
'C:\Folder\...
Dim path as string
path = "C:\Folder\.."
Dim fso
set fso = createobject("Scripting FileSystemObjh)
我尝试了一些方法,它只打开文件夹但没有获取文件路径,所以不是我想要做的。
当我选择文件并单击“确定”时,文件路径将打印在文本框中。
先感谢您!
I have a button and a textbox and I want to make the button to open the folder by a default path.
I will give example:
'C:\Folder\...
Dim path as string
path = "C:\Folder\.."
Dim fso
set fso = createobject("Scripting FileSystemObjh)
I tried some method where it only opens the folder but doesn't get the file path so not what I want to do.
And when I select the file and click okay the file path to be printed on the textbox.
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我了解您的需求,那么以下内容应该为您指明正确的方向。首先,选择以下组件:
其次,选择以下参考:
第三,将 CommonDialog 控件以及 CommandButton 和 TextBox 拖放到窗体上。输入以下代码:
If I understand what you need, the following should point you in the right direction. First, select the following Component:
Second, select the following Reference:
Third, drop a CommonDialog control onto your form along with the CommandButton and TextBox. Type the following code: