Private Sub folderMenuItem_Click(sender As object, e As System.EventArgs) _
Handles folderMenuItem.Click
' Show the FolderBrowserDialog.
Dim result As DialogResult = folderBrowserDialog1.ShowDialog()
If ( result = DialogResult.OK ) Then
folderName = folderBrowserDialog1.SelectedPath
If (not fileOpened) Then
' No file is opened, bring up openFileDialog in selected path.
openFileDialog1.InitialDirectory = folderName
openFileDialog1.FileName = nothing
openMenuItem.PerformClick()
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnopens1.Click
'Dim BrowseFolder As New FolderBrowserDialog 'อันนี้ก็ใช้ได้นะครับ 3บรรทัด
'BrowseFolder.ShowDialog() '
'txtMaster.Text = BrowseFolder.SelectedPath'
'หรือจะนำเครื่องมือ FolderBrowserDialog1 มาวางแล้วเขียนโค๊ดตามนี้นะครับ
FolderBrowserDialog1.ShowDialog()
txtMaster.Text = FolderBrowserDialog1.SelectedPath
End Sub