祝大家好运。当搜索FolderBrowserDialog的替代项时,我在这里找到了提及“ ookii对话框”库的答案,我想在我的项目中使用这些对话框。对于VB.NET来说,它非常陌生,我找不到精确的说明将其成功添加到我的项目中。
我什至不确定是否可行,因为我发现的ookii对话框库代码是用C#编码的,而我的应用程序是用Visual Basic编码的。可能吗?包含的.dll是否可以正常使用?
我使用Sharpdevelop 4.4.2。这是我到目前为止所尝试的:
我虽然很好,因为现在SharpDevelop的自动建议功能使我可以固定到ookii库的属性和方法,但是尝试进行编译时出现“未定义类型”错误
Dim zzz As Ookii.Dialogs.VistaFolderBrowserDialog
我是否只是缺少正确的'进口'声明?
预先感谢
是,okki对话框在vb.net中有效。检查documentation。
有一个例子VistaFolderBrowserDialog
。
Imports Ookii.Dialogs
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim dlg As VistaFolderBrowserDialog = New VistaFolderBrowserDialog()
'show the dialogbox for the user to choose the folder
Dim folderResult As Object = dlg.ShowDialog
'you can get the selected parth with this. Here I put it in a textbox.
TexBox1.Text = dlg.SelectedPath
End Sub