webbrowser-control

Windows forms web browser control zoom level

冷暖自知 提交于 2019-12-01 05:24:50
问题 I'm using a web browser control to display some on-the-fly generated HTML documents in my application. Problem is, on my machine said documents are displayed kinda zoomed in. On other colleagues' computers, everything looks "normal". It has to be some kind of local setting but I can't find where to change it. I can CTRL + Scroll wheel to zoom out, but zoom level is not retained. As far as I can see, there's no easy way to set the predefined zoom level programmatically. It may be a long shot

WebBrowser control not auto-selecting text on double-click after IE 10 install

假装没事ソ 提交于 2019-12-01 04:43:28
NOTE: This is about the control's built-in behavior, not about creating a double-click event. One of my projects uses the Windows.Forms.WebBrowser control as an editor and viewer for HTML. It has been working fine for years but suddenly I noticed that before when I would double-click it would automatically select the word which was clicked (this was not my code, just happened with the control). Suddenly (not exactly sure when), double clicking text in the control (both in edit mode or in view mode) does nothing. It's hard to troubleshoot because it is not my code doing it, however, since I

InvokeRequired of Form == false and InvokeRequired of contained control == true

北慕城南 提交于 2019-12-01 04:35:39
how is it possible? I have windows Form control, derived from System.Windows.Forms.Form with WebBrowser control contained in this form. Webbrowser object instance is created in constructor of form (in InitializeComponent() method). Then in background thread I manipulate with content of WebBrowser, and I found that in some cases Form.InvokeRequired == false, while WebBrowser.InvokeRequired == true. How can it be? Form.InvokeRequired returns false before the form is shown. I did a simple test: Form2 f2 = new Form2(); Thread t = new Thread(new ThreadStart(() => PrintInvokeRequired(f2))); t.Start(

How to add a reference to mshtml version 9 in .NET

十年热恋 提交于 2019-12-01 04:29:19
I want to use some of the new features of mshtml.dll version 9.0 such as IHTMLCSSRule. The interop version in the following folder is version 7.0.3300.1: C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll The COM version in the following folder is version 9.0.8112.16441: C:\Windows\System32\mshtml.dll From what I could ascertain from the web, I should do this to create a .NET interop version 9: d:\zTemp>tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversi on:9.0 This seems to have worked but generated the following warnings: TlbImp : warning

Setting Value of an Input Tag in WebBrowser Control

不打扰是莪最后的温柔 提交于 2019-12-01 03:46:21
I am attempting to help a user log into their account using a custom WebBrowser control. I am trying to set the value of an input tag to the players username using the WebBrowser 's InvokeScript function. However, my current solution is doing nothing but rendering a blank white page. My current code looks like this (web is the name for my WebBrowser control): web.Navigate(CurrentURL, null, @"<script type='text/javascript'> function SetPlayerData(input) { username.value = input; return true; } </script>"); web.Navigated += (o, e) => { web.IsScriptEnabled = true; web.InvokeScript("SetPlayerData"

How to navigate in a list of links using webbrowser?

半城伤御伤魂 提交于 2019-12-01 03:38:19
问题 I have a list of url and I need to navigate them. How can I make sure that every url will call the DocumentCompleted event ? I've already tried to create many threads and tried using a single thread too but the app is still not firing the event DocumentCompleted for each url. Is there a way to make a loop in a list of urls and make them call a DocumentCompleted until the thread calls the next url ? 回答1: To implement this, async/await and Task Parallel Library may come in handy. They allow to

WPF webbrowser control vs winforms

隐身守侯 提交于 2019-12-01 03:26:07
问题 I am creating a wpf application where I am using a webbrowser control. anyways sometimes I am required to look for html elements, invoke clicks, and other basic functionality. In winforms webbrowser control I am able to achieve this by doing: webBrowser1.Document.GetElementById("someId").SetAttribute("value", "I change the value"); In wpf webbrowser control I managed to achieve the same thing by doing: dynamic d = webBrowser1.Document; var el = d.GetElementById("someId").SetAttribute("value",

WebBrowser control not auto-selecting text on double-click after IE 10 install

你离开我真会死。 提交于 2019-12-01 02:25:47
问题 NOTE: This is about the control's built-in behavior, not about creating a double-click event. One of my projects uses the Windows.Forms.WebBrowser control as an editor and viewer for HTML. It has been working fine for years but suddenly I noticed that before when I would double-click it would automatically select the word which was clicked (this was not my code, just happened with the control). Suddenly (not exactly sure when), double clicking text in the control (both in edit mode or in view

How to add a reference to mshtml version 9 in .NET

北城余情 提交于 2019-12-01 01:35:23
问题 I want to use some of the new features of mshtml.dll version 9.0 such as IHTMLCSSRule. The interop version in the following folder is version 7.0.3300.1: C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll The COM version in the following folder is version 9.0.8112.16441: C:\Windows\System32\mshtml.dll From what I could ascertain from the web, I should do this to create a .NET interop version 9: d:\zTemp>tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml

Clear temporary internet files via “C#”

荒凉一梦 提交于 2019-12-01 01:27:27
I am using webbrowser control in windows application.i was viewing url content inside the webbrowser control. here the url content values are stored in temporary internet files of user machine. when i click close button in my form i was deleting the temporary internet files programatically. and it is working fine. but during deletion a "message box came and saying deleting temporary internet files". here i dont want to show that dialog box during deletion. below is code to delete the temp files for users machine. how to handle this.. void DeleteBrowserTempFile() { string args = ""; args = (