WebBrowser as File Browser (Explorer)

This is working but how will i change the view (Thumbnail, Details, List, etc.)

Is it posible

Private Sub Navigate(ByVal address As String)

If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("file:///") Then
address = "file:///" & address
End If

Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub



Answer this question

WebBrowser as File Browser (Explorer)

  • jstookey

    hi,

    ok look i didn't say you can't but windows explorer is different than i explorer ok you using web control , open your IE and browse you hard drive you will find the menus items changed particulary the view menu also if you have a programs that add icons to your webbrowser you will find them appear and disapear depending on what you are dong so at end its same interface running 2 programs

    you can do that even though to get (details,largeicons, smallicons, list ) as what you said webbrowser will not give you this result

    the best solution that i know about this is to add 2 controls to your project (webbroswer for internet) and ( listview for you hard drive ) and to use the file name to determine which control to show and which one to hide

    and you can make arraylist to hold the addresses that you use or simply you can use this as a field in your class

    private System.Collections.Specialized.StringCollection FolderCol= new System.Collections.Specialized.StringCollection();

    you can use it to hold the addresses that you use and to add to it when user click go and to remove from it when user click back and depending on the last item name you can determine its web or HDD to use proper control

    Hope this helps



  • pappu

    hi,

    i guess there are differences between Internetexplorer and windowsexplorer

    web browser control can do the internetexplorer job , listview can do windowsexplorer job 2 different things may be you can hardcode the webbrowser to do this job but eventhough it will not make it normal thing

    so you have 2 choices 1 to hardcode your webbrowser html to do this job or other wise to you use the control that have been designed for that as what Reenec told you

    Best regards



  • Hockeyanimal

    O well. i think im just improvising i think it would be possible because i use windows explorer as my internet browser most often. It's just that i'm doing a program (Font Explorer) that's why. Thanks for the replies. i'll let you informed if it really works.


  • gd52

    It works i know it can. i can browse folders and files as if you are using Explorer. what i want is to change it's view. i saw it once in the internet but can't find it anymore.


  • MGS_FireEngineer

    Let's stop and think things over for a second.

    Consider the controls that ASP has for web display. I think some of them do emulate web based treeviews.

    BUT WHY do this Yes, I can pound a thimble into a needle....

    But why when I am ample supply of both thimbles and needles



  • Mexx

    I don't think you will. The webBrowser is an HTML based control and is not a treeview or list view control.

    There would be one way of course which whould be be you wanted to build HTML wrappers around the contents you are interested in but that's not very practical.



  • WebBrowser as File Browser (Explorer)