Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:01:52+00:00 2026-05-15T22:01:52+00:00

How can I disable dropping of files on a System.Windows.Controls.WebBrowser? From the documentation it

  • 0

How can I disable dropping of files on a System.Windows.Controls.WebBrowser? From the documentation it would seem that this behaviour should be disabled by default as it is inherited from the UIElement.AllowDrop Property.

However dy default I can drag and drop files on to a WebBrowser control. Further to this it seems I can’t disable this supposedly none-default behaviour. For example if I explicitly set the value of the property to false in XAML

<WebBrowser Name="webBrowser1" AllowDrop="False" />

..and/or in code-behind, i.e.

webBrowser1.AllowDrop = false;

Then I can still drag and drop files onto the control. How can I disable this behaviour and remove the security risk it creates?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:01:53+00:00Added an answer on May 15, 2026 at 10:01 pm

    Ok after hours and hours of playing with this I have come up with one solution that works. Because I am using the standard WPF webbrowser I know I can also use the “Extended Event Attributes” that Microsoft introduced for Internet Explorer.

    The event I am using to disable dropping files onto the control is ondragover. Essentially I just cancel the event whenever it happens like so.

    <body ondragover="window.event.returnValue=false;">
    

    This is not really ideal – but what is good about this technique is that it allows for a whole host of other properties to be set that are not available directly from managed code. For the scrollbar state, which is not exposed in managed code, can be set this way.

    <body scroll="no">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this rather neat approach I can disable weekends and holidays from the datepicker.
How can I disable all MSVC warnings that come from the boost library? I
From this post, Android disable screen timeout while app is running , I can
I can disable one and one by doing this: jQuery('#ListBoxA').attr('disabled','true'); But how can I
Can someone tell me how I can disable all controls within a div? The
I’ve read that you can disable (make physically unclickable) an HTML button simply by
$(this).closest(fieldset).find(input:not(:checkbox), select,textarea).attr('disabled', this.checked); with this I can Disable Input,select,textarea how to do with the
I've been seeing a lot of websites saying that you can disable the effects
How i can disable lighting for only one of the textures in this multitexturing
I can get the form id with form_id= $(this).parents('form').attr('id'); I can disable/enable ALL the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.