0

Im writing client's app that behaviour mostly like browser, but it looks like a program.

Im using cefsharp and chromium web browser for it, no any buttons or anything else - just window with browser inside.

I want to disable item dragging (when click on button that open another page and move it - link appears / or drag a picture).

Is it possible to achieve?

Using Visual Studio 2017, C#.

Vadim
  • 3,855
  • 2
  • 17
  • 22

1 Answers1

1

so easy.

 chromeBrowser.ExecuteScriptAsyncWhenPageLoaded("document.ondragstart=()=>{return false}");

See More: WebBrowserExtensions.ExecuteScriptAsyncWhenPageLoaded Method

拉拉姬
  • 140
  • 1
  • 8
  • While this code may resolve the OP's issue, it is best to include an explanation as to how your code addresses the OP's issue. In this way, future visitors can learn from your post, and apply it to their own code. SO is not a coding service, but a resource for knowledge. Also, high quality, complete answers are more likely to be upvoted. These features, along with the requirement that all posts are self-contained, are some of the strengths of SO as a platform, that differentiates it from forums. You can edit to add additional info &/or to supplement your explanations with source documentation. – ysf Jun 20 '20 at 20:05