BrowseForFoldersDialog – A class to display the BrowseForFolders dialog box

' a class to display the BrowseForFolders dialog' usage:'   Dim diag As New BrowseForFoldersDialog()'   diag.Description = "Select a directory"'   If diag.ShowDialog() = DialogResult.OK Then'      ' the user selected this directory'      directory = diag.Path'   End If'' IMPORTANT: requires a reference to the System.Design.Dll assemblyClass BrowseForFoldersDialog    ' the Description that appears in the dialog    Dim m_Description As String    Property Description() As String        Get            Return m_Description        End Get        Set(ByVal Value As String)            m_Description = Value        End Set    End Property    ' the path returned by the dialog    Dim m_Path As String    Property Path() As String        Get            Return m_Path        End Get        Set(ByVal Value As String)            m_Path = Value        End Set    End Property    ' the ShowDialog method    Function ShowDialog() As System.Windows.Forms.DialogResult        Dim fb As New FolderBrowser(Me)        Return fb.ShowDialog()    End Function    ' an inner private class that inherits from a .NET Framework class    ' we need this class because we want to access protected members    Private Class FolderBrowser        Inherits System.Windows.Forms.Design.FolderNameEditor        Dim parent As BrowseForFoldersDialog        ' store a reference to the outer object, so that its        ' private properties can be accessed        Sub New(ByVal parent As BrowseForFoldersDialog)            Me.parent = parent        End Sub        ' show the dialog        Function ShowDialog() As System.Windows.Forms.DialogResult            Dim fb As New _                System.Windows.Forms.Design.FolderNameEditor.FolderBrowser()            fb.Description = parent.m_Description            ShowDialog = fb.ShowDialog()            If ShowDialog = Windows.Forms.DialogResult.OK Then                parent.m_Path = fb.DirectoryPath            End If        End Function    End ClassEnd Class

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may