|
-
August 27th, 2009, 01:36 PM
#1
Folder Browser dialog
Below code is opening Folder Browser dialog on button click, I want that if mine PC is in network..In Folder Browser Dialog even the network drives are coming,I want that Network Places do not come in treeview.Is it possible??
Code:
Option Strict On
Option Explicit On
Option Compare Text
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim obj As New FolderBrowserDialog
If obj.ShowDialog = Windows.Forms.DialogResult.OK Then
MsgBox(obj.SelectedPath)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
-
August 27th, 2009, 07:30 PM
#2
Re: Folder Browser dialog
Try this
Code:
' First create a FolderBrowserDialog object
Dim FolderBrowserDialog1 As New FolderBrowserDialog
' Then use the following code to create the Dialog window
' Change the .SelectedPath property to the default location
With FolderBrowserDialog1
' Desktop is the root folder in the dialog.
.RootFolder = Environment.SpecialFolder.Desktop
' Select the C:\Windows directory on entry.
.SelectedPath = "c:\windows"
' Prompt the user with a custom message.
.Description = "Select the source directory"
If .ShowDialog = DialogResult.OK Then
' Display the selected folder if the user clicked on the OK button.
MessageBox.Show(.SelectedPath)
End If
End With
After you press a ., you should see ALL the available options for the FB
There is probably a flag for network drives.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|