Skip to content

Suppress WebBrowser's file browser... Is there a way?!?!

Jacob R

Asked Jan 30, 2010, 2:30 PM EST1 answer
Share
LinkedInX
When using a WebBrowser object is there a way to suppress the file browser dialog that pops up when an html "<input type=file" tag is clicked?  What I want to do is .show() a custom form to browse for the file that I want to submit.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    How about forcing it to be minimized...  When the dialog box pops up, you do lose control of the parent form but I've see a few times, when playing around with the WebBrowser object, that the "Choose File to Upload" was detached from the parent form by some unknown power which, in turn, allowed the parent form to be interacted with.  So, the direction would be to detatch it from the parent and then minimize it which would hide it because it doesn't open with a task bar button and then, .Show() your custom form to browse for the file and PostMessage that file path to the "Edit" class of the "Choose File to Upload" dialog box (Class: #32770) with a PostMessage enter key going to the "ComboBoxEx32" class of said dialog box.   
     
    Any ideas on the subject would be great!!
    0