FolderBrowserDialog questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Dufour

    FolderBrowserDialog questions

    Public Sub ChooseFolder()
    If FolderBrowserDi alog1.ShowDialo g() = DialogResult.OK Then
    TextBox1.Text = FolderBrowserDi alog1.SelectedP ath
    End If
    End Sub
    First In Vs2005 the if statement is not correct, it says it will not be
    evaluated.(wavy underlines on DialogResult.OK Second my users need to be able
    to navigate the network neighborhood and it does not seem to get selected. I
    see that the only way would be to map a network folder then it would become
    visible in the dialog. Is there a way to allow navigating thrue the network
    neighborhood without mapping a folder?Thanks for any help,Bob


  • Robert Dufour

    #2
    Re: FolderBrowserDi alog questions

    Disregard question 2 please, I found it, finger trouble :-)
    Bob
    "Robert Dufour" <bdufour@sgiims .comwrote in message
    news:uLM7bigJHH A.2312@TK2MSFTN GP02.phx.gbl...
    Public Sub ChooseFolder()
    If FolderBrowserDi alog1.ShowDialo g() = DialogResult.OK Then
    TextBox1.Text = FolderBrowserDi alog1.SelectedP ath
    End If
    End Sub
    First In Vs2005 the if statement is not correct, it says it will not be
    evaluated.(wavy underlines on DialogResult.OK Second my users need to be
    able to navigate the network neighborhood and it does not seem to get
    selected. I see that the only way would be to map a network folder then it
    would become visible in the dialog. Is there a way to allow navigating
    thrue the network neighborhood without mapping a folder?Thanks for any
    help,Bob
    >

    Comment

    • Robert Dufour

      #3
      Re: FolderBrowserDi alog questions

      OK found it.
      Thanks to all and merry Christmas
      "Robert Dufour" <bdufour@sgiims .comwrote in message
      news:uLM7bigJHH A.2312@TK2MSFTN GP02.phx.gbl...
      Public Sub ChooseFolder()
      If FolderBrowserDi alog1.ShowDialo g() = DialogResult.OK Then
      TextBox1.Text = FolderBrowserDi alog1.SelectedP ath
      End If
      End Sub
      First In Vs2005 the if statement is not correct, it says it will not be
      evaluated.(wavy underlines on DialogResult.OK Second my users need to be
      able to navigate the network neighborhood and it does not seem to get
      selected. I see that the only way would be to map a network folder then it
      would become visible in the dialog. Is there a way to allow navigating
      thrue the network neighborhood without mapping a folder?Thanks for any
      help,Bob
      >

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: FolderBrowserDi alog questions

        "Robert Dufour" <bdufour@sgiims .comschrieb:
        Public Sub ChooseFolder()
        If FolderBrowserDi alog1.ShowDialo g() = DialogResult.OK Then
        TextBox1.Text = FolderBrowserDi alog1.SelectedP ath
        End If
        End Sub
        First In Vs2005 the if statement is not correct, it says it will not be
        evaluated.(wavy underlines on DialogResult.OK Second my users need to be
        able to navigate the network neighborhood and it does not seem to get
        selected.
        That's because 'DialogResult' is both a property name and a type name and
        the compiler binds it to the form's property and access its shared member
        'OK'. Use this code instead:

        \\\
        Imports WinForms = System.Windows. Forms
        ....
        If ... = WinForms.Dialog Result.OK Then
        ...
        End If
        ///

        As an alternative you could fully qualify 'DialogResult' in your code.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        Working...