如何制作“选择目录名称”对话 [英] how to make a "select directory name" dialog

查看:78
本文介绍了如何制作“选择目录名称”对话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好 -


如何制作选择目录名称?对话框?


如果一个人可以使用FileOpenDialog但是看起来不是很直接,那就太好了。

无论如何,如果您有任何提示或其他方面,请发送给他们。


谢谢。


- 马克


Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark


推荐答案

文章< el ************** @ TK2MSFTNGP11 .kx.gbl>,Mark Kamoski写道:
In article <el**************@TK2MSFTNGP11.phx.gbl>, Mark Kamoski wrote:
大家好 -

如何制作一个选择目录名称?对话框?

如果可以使用FileOpenDialog但是看起来不是直截了当会很棒。

无论如何,如果你有任何提示或者,请发送给他们。

谢谢。

- 标记
Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark




您使用的是什么版本的视觉工作室?如果您使用2003 - 它已经包含了

。它被称为FolderBrowserDialog控件。如果

你使用2002 ...嗯,你有两个选择。您可以使用

SHBrowseForFolder API调用。或者,您可以创建一个从System.Windows.Forms.Design.FileNameEditor继承

的类。这将给你

访问受保护类型FileNameEditor.FolderBrowser :)所以,

类似于:

Public Class DirectoryBrowser

继承System.Windows.Forms.Design.FileNameEditor


私人浏览器As New FolderBrowser


...

结束课


HTH

-

Tom Shelton

MVP [Visual Basic]



What version of visual studio are you using? If your using 2003 - it is
already included. It is called the FolderBrowserDialog control. If
your using 2002... Well, you have two choices. You can use the
SHBrowseForFolder API call. Or you can create a class that inherits
from System.Windows.Forms.Design.FileNameEditor. This will give you
access to the protected type FileNameEditor.FolderBrowser :) So,
something like:

Public Class DirectoryBrowser
Inherits System.Windows.Forms.Design.FileNameEditor

Private browser As New FolderBrowser

...
End class

HTH
--
Tom Shelton
MVP [Visual Basic]


Tom -


感谢您的回复。


我不能说我很开心,wrt VS.NET 2002.


实际上我的研究给我带来了同样的结论(从判断

我最近在 www.Google.com 上找到的内容;但是,我正在希望我错了,并且在VS.NET中可能有更好的方法,但是......哦,好吧。


谢谢回复。


- 马克

Tha

" Tom Shelton" < to*@mtogden.com>在消息中写道

新闻:Ov *************** @ TK2MSFTNGP11.phx.gbl ...

文章< elV**************@TK2MSFTNGP11.phx.gbl> ;, Mark Kamoski写道:
Tom--

Thank you for the reply.

I can''t say I''m happy about it, wrt VS.NET 2002.

In fact my research had brought me to the same conclusion (judging from
what I found on www.Google.com recently); but, I was HOPING that I was
wrong and that there might be a better way in VS.NET but... oh well.

Thank you for the reply.

--Mark
Tha
"Tom Shelton" <to*@mtogden.com> wrote in message
news:Ov***************@TK2MSFTNGP11.phx.gbl...
In article <el**************@TK2MSFTNGP11.phx.gbl>, Mark Kamoski wrote:
大家好 -

如何才能制作选择目录名称对话框?

如果一个人可以使用FileOpenDialog但它不是
似乎是直截了当的话会很棒。

无论如何,如果你有任何提示或者,请发送给他们。

谢谢。

- 标记
Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not seem to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark




您使用的是什么版本的视觉工作室?如果您使用2003 - 它已经包含了

。它被称为FolderBrowserDialog控件。如果

你使用2002 ...嗯,你有两个选择。您可以使用

SHBrowseForFolder API调用。或者,您可以创建一个从System.Windows.Forms.Design.FileNameEditor继承

的类。这将给你

访问受保护类型FileNameEditor.FolderBrowser :)所以,

类似于:

Public Class DirectoryBrowser

继承System.Windows.Forms.Design.FileNameEditor


私人浏览器As New FolderBrowser


... 。

结束课


HTH

-

Tom Shelton

MVP [Visual Basic]



What version of visual studio are you using? If your using 2003 - it is
already included. It is called the FolderBrowserDialog control. If
your using 2002... Well, you have two choices. You can use the
SHBrowseForFolder API call. Or you can create a class that inherits
from System.Windows.Forms.Design.FileNameEditor. This will give you
access to the protected type FileNameEditor.FolderBrowser :) So,
something like:

Public Class DirectoryBrowser
Inherits System.Windows.Forms.Design.FileNameEditor

Private browser As New FolderBrowser

....
End class

HTH
--
Tom Shelton
MVP [Visual Basic]


如果您不喜欢这个建议,请尝试使用锤子和钉子。也许这些工具更适合您的使用。


Mark Kamoski < mk ****************************************** @ yaho o.com> ;

在留言新闻中写道:eV ************** @ TK2MSFTNGP10.phx.gbl ...
Well if you don''t like that suggestion try using a hammer and nails. maybe
those tools are more appropriate for your use.

"Mark Kamoski" <mk******************************************@yaho o.com>
wrote in message news:eV**************@TK2MSFTNGP10.phx.gbl...
Tom - <谢谢你的回复。

我不能说我很开心,wrt VS.NET 2002.

事实上,我的研究给我带来了同样的结论(从我在 www.Google上找到的内容来判断) .com 最近);但是,我希望我错了,VS.NET中可能有更好的方法,但是......好吧。

谢谢你的回复。

- Mark

Tha
Tom Shelton < to*@mtogden.com>在消息中写道
新闻:Ov *************** @ TK2MSFTNGP11.phx.gbl ...
在文章< el ******* *******@TK2MSFTNGP11.phx.gbl> ;, Mark Kamoski写道:
Tom--

Thank you for the reply.

I can''t say I''m happy about it, wrt VS.NET 2002.

In fact my research had brought me to the same conclusion (judging from
what I found on www.Google.com recently); but, I was HOPING that I was
wrong and that there might be a better way in VS.NET but... oh well.

Thank you for the reply.

--Mark
Tha
"Tom Shelton" <to*@mtogden.com> wrote in message
news:Ov***************@TK2MSFTNGP11.phx.gbl...
In article <el**************@TK2MSFTNGP11.phx.gbl>, Mark Kamoski wrote:
大家好 -

如何制作一个选择目录名称 ;对话框?

如果可以使用FileOpenDialog但它不会
Hi Everyone--

How can one to make a "select directory name" dialog?

It would be great if one could use the FileOpenDialog but it does not


看起来

是直截了当的话会很棒。

无论如何,如果您有任何提示或其他方面,请发送给他们。

谢谢。

- 马克
to be straight-forward.

Anyway, if you have any hints or otherwise, please send them along.

Thank you.

--Mark



您使用的是哪个版本的visual studio?如果您使用2003 - 它已经包含在内了。它被称为FolderBrowserDialog控件。如果你使用2002年...嗯,你有两个选择。您可以使用
SHBrowseForFolder API调用。或者,您可以创建一个从System.Windows.Forms.Design.FileNameEditor继承
的类。这将使您可以访问受保护类型FileNameEditor.FolderBrowser :)所以,
类似于:

公共类DirectoryBrowser
继承System.Windows.Forms.Design .FileNameEditor

私人浏览器As New FolderBrowser

...
结束课

HTH
-
Tom Shelton
MVP [Visual Basic]



What version of visual studio are you using? If your using 2003 - it is
already included. It is called the FolderBrowserDialog control. If
your using 2002... Well, you have two choices. You can use the
SHBrowseForFolder API call. Or you can create a class that inherits
from System.Windows.Forms.Design.FileNameEditor. This will give you
access to the protected type FileNameEditor.FolderBrowser :) So,
something like:

Public Class DirectoryBrowser
Inherits System.Windows.Forms.Design.FileNameEditor

Private browser As New FolderBrowser

...
End class

HTH
--
Tom Shelton
MVP [Visual Basic]



这篇关于如何制作“选择目录名称”对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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