Results 1 to 6 of 6

Thread: WebBrowser Control as File Explorer; how to search folders?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2014
    Posts
    7

    WebBrowser Control as File Explorer; how to search folders?

    I am using Visual Studio Express 2013 for Desktop, Windows 7. I have a form with a webbrowser control used as a file explorer, with the URL set to a shared folder on our network (the S:\ drive). I would like for the user to be able to search for a particular folder in the list by using some sort of "Find Dialog," usually accessible by CTRL+F in Windows Explorer. CTRL+F works just fine on a webbrowser control if the URL is set to an actual Web URL, but it doesn't seem to work at all if it's a local folder. I've tried using SendKeys but no luck. Is there any way to create a find dialog for the control being used in this way?

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: WebBrowser Control as File Explorer; how to search folders?

    Before diving too deep into options for the webbrowser as a file explorer, is there a reason you can't use the openfiledialog or something similar to that? The browser is not a particularly great file explorer.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2014
    Posts
    7

    Re: WebBrowser Control as File Explorer; how to search folders?

    Well, the short version of why I'm using the webbrowser is that I found all the solutions out there for building my own file explorer through treeview/listview to be too complicated. It also has to do with what we're using the form for. Basically, each folder in the S:\ drive represents a certain property (we're a construction company), and contains data about the job(s) we're doing at that property (info like the property address, the Realtor's name, comments about the job, dates when tasks were completed. etc.) as well as related files (invoices, pictures, etc.). The property data is saved in .xml files within each folder, and when a user browses to each folder's property, information about that particular property is loaded from the .xml files and displayed in textboxes and datetimepickers on either side of the webbrowser control. They can add or change the data and save it to the .xml files within the folder that they've browsed to.

    If there was a simple way of just embedding an openfiledialog within the form somehow, rather than having it open in its own window, I suppose that would solve the problem, but I have no idea how that would work.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: WebBrowser Control as File Explorer; how to search folders?

    Check out this API Codepack from Microsoft. One of the code classes they feature in it is the Explorer Browser Control.

    http://archive.msdn.microsoft.com/WindowsAPICodePack

    When/if you download the code, there is an ExplorerBrowser VB sample in the samples folder. It should be pretty easy to integrate this into your own project.

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2014
    Posts
    7

    Re: WebBrowser Control as File Explorer; how to search folders?

    The sad truth is that I've already tried that and can't make heads or tails of it. It seems incredibly complex.

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2014
    Posts
    7

    Re: WebBrowser Control as File Explorer; how to search folders?

    Okay, I spent a little more time this afternoon playing with the ExplorerBrowser control and was actually able to get it working, but incredibly, CTRL+F still doesn't seem to work, so regardless of how we implement this, it looks like I still need a solution to this problem. Sigh.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width