WebBrowser Control Puzzle - Setting Folder View

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • float
    New Member
    • Dec 2007
    • 2

    WebBrowser Control Puzzle - Setting Folder View

    Hello all,

    I have an application I have written in VB that utilizes the web browser control. Users can access webpages with it but also scan folders on their computer. Here is my question that I have yet to see anybody resolve (even though others have asked the exact same thing in other forums):


    How do I automatically set the folder view to "View Details" if the user navigates to a folder on their computer instead of an html address?

    I would like to do this as simply as possible (codewise) from within the webbrowser.

    By right-clicking, I can access the context menu and manually change it to "View"-->"Details" but is there a way to do this programmaticall y within VB?
    Thanks!


    P.S., I would like to do this without requiring the user to change any of their IE explorer settings (or Windows folder view settings).
  • float
    New Member
    • Dec 2007
    • 2

    #2
    Here is an easy to make example that demonstrates my issue.

    On a new windows form:

    1.) Place a button, textbox, and WebBrowser control.

    2.) Use the following code for form 1:



    Public Class Form1

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

    WebBrowser1.Nav igate(TextBox1. Text)

    End Sub

    End Class



    3.) Run the program

    4.) Type a drive (for example, c:\) or folder path (c:\documents and settings) into the textbox and press the button

    5.) Depending on the folder or path you typed in, the folder view you see in the WebBrowser is not always “details” view. However, you can right-click on the WebBrowser and select “View”à “Details” to see the folders in detailed view.

    It is driving me crazy that I cannot figure out how to get VB to always display the contents in “Details” view even though that option is available on the right-click context menu while the app is running. Anybody have any thoughts?

    Comment

    Working...