VB.Net Tutorial/GUI/FolderBrowserDialog — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 12:57, 26 мая 2010
Get the SelectedPath FolderBrowserDialog
Imports System.Windows.Forms
Public Class Tester
Public Shared Sub Main
Dim DirectoryBrowser As System.Windows.Forms.FolderBrowserDialog
DirectoryBrowser = New System.Windows.Forms.FolderBrowserDialog
DirectoryBrowser.Description = "Which directory do you want to use?"
If (DirectoryBrowser.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Console.WriteLine(DirectoryBrowser.SelectedPath)
End If
End Sub
End Class
Set Properties for FolderBrowserDialog
Imports System.Windows.Forms
public class FolderBrowserDialogProperty
public Shared Sub Main
Dim FolderBrowserDialog1 As FolderBrowserDialog = New System.Windows.Forms.FolderBrowserDialog
With FolderBrowserDialog1
.RootFolder = Environment.SpecialFolder.rumonProgramFiles
.SelectedPath = "C:\Temp"
.ShowNewFolderButton = False
.Description = "Use the tree below to select a folder:"
End With
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Console.WriteLine(FolderBrowserDialog1.SelectedPath)
End If
End Sub
End class