By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

WebBrowser Control Puzzle - Setting Folder View

P: 2
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 programmatically 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).
Dec 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: 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(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

WebBrowser1.Navigate(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?
Dec 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.