webbrowser-control

Second WebBrowser control with SignalR freezes javascript

女生的网名这么多〃 提交于 2020-06-16 20:33:19
问题 In my WinForm application, I have a "main" .net WebBrowser control with the following JS: var $hub; $(function () { $hub = $.connection.sendHub; $.connection.hub.stateChanged(connectionStateChanged); $.connection.hub.disconnected(function () { setTimeout(function () { $.connection.hub.start(); }, 10000); }); $hub.client.broadcastMessage = function (action, argument, tag) { // Do something }; $.connection.hub.start({ waitForPageLoad: false }).done(function () { }); function

Second WebBrowser control with SignalR freezes javascript

风流意气都作罢 提交于 2020-06-16 20:33:09
问题 In my WinForm application, I have a "main" .net WebBrowser control with the following JS: var $hub; $(function () { $hub = $.connection.sendHub; $.connection.hub.stateChanged(connectionStateChanged); $.connection.hub.disconnected(function () { setTimeout(function () { $.connection.hub.start(); }, 10000); }); $hub.client.broadcastMessage = function (action, argument, tag) { // Do something }; $.connection.hub.start({ waitForPageLoad: false }).done(function () { }); function

What is the WPF equivalant of DocumentCompleted?

江枫思渺然 提交于 2020-05-29 03:59:05
问题 I checked. This question has not been asked yet. What is the WPF equivalant of DocumentCompleted for the WebBrowser class? the DocumentCompleted method does not exist in WPF (at least not in the latest version of .NET and visual studio). So how do I do the same thing that one could do with Windows Forms in WPF? 回答1: The event that you are looking for is LoadCompleted. Your can read more about it in .NET docs here http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser

NET webbrowser - get HTML element ID by clicking on image

◇◆丶佛笑我妖孽 提交于 2020-05-18 19:45:54
问题 I have a C# winform project with a webbrowser control. I'm loading an HTML page with images into the webbrowser. Each image has a different ID: <img src="F:\Temp\file12948.jpg" id="12948" width="180px"> Is there a way to pass the ID into a variable when clicking on the image so I can use the ID in my code? The path to the image can also be used as I can extract the number from there. I have already searched here there and everywhere for a solution but can't find anything related. 回答1: You can

WebBrowser Html Document to Image

梦想的初衷 提交于 2020-05-13 17:54:11
问题 I'm trying to make image of webpage, but some pages shows me as white page. In Registry editor browse \HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\ and add there this: WindowsFormsApp1.exe with decimal value 11000 WindowsFormsApp1.vshost.exe with decimal value 11000 Here is my code: using System; using System.Collections.Generic; using System.Windows.Forms; using System.Drawing; using System.Drawing.Imaging; using System.Runtime

WebBrowser Html Document to Image

梦想的初衷 提交于 2020-05-13 17:52:23
问题 I'm trying to make image of webpage, but some pages shows me as white page. In Registry editor browse \HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\ and add there this: WindowsFormsApp1.exe with decimal value 11000 WindowsFormsApp1.vshost.exe with decimal value 11000 Here is my code: using System; using System.Collections.Generic; using System.Windows.Forms; using System.Drawing; using System.Drawing.Imaging; using System.Runtime

Webbrowser completed doesn't show all elements

久未见 提交于 2020-03-24 10:21:21
问题 I have a webbrowser which is loading a website. If the website firing the "completed" event, my HTMLElementCollection shows me a count of "179". If I click on the button and call the same method to get all HTMLElements, it tells me a count of "194". The problem is: if the "completed"-Event is firing, some HTMLElements are not loaded, and needs a longer time, and my HTMLElement which I need to click on it, is missing too. To explain with code: private void Webbrowser_DocumentComplete(object

Is it not possible to add our own menu items on the CHtmlView context menu?

。_饼干妹妹 提交于 2020-03-18 09:00:00
问题 So I keep coming back to this article on CodeProject: https://www.codeproject.com/Articles/4758/How-to-customize-the-context-menus-of-a-WebBrowser I then realised this statement at the top of the article: The revised sample projects are using a new , much better customization approach that is going to be comprehensively discussed in the next update of this article, which will hopefully be ready in a couple of weeks. I am publishing this semi-documented and not fully-tested code, because I am

Is it not possible to add our own menu items on the CHtmlView context menu?

半城伤御伤魂 提交于 2020-03-04 20:50:39
问题 So I keep coming back to this article on CodeProject: https://www.codeproject.com/Articles/4758/How-to-customize-the-context-menus-of-a-WebBrowser I then realised this statement at the top of the article: The revised sample projects are using a new , much better customization approach that is going to be comprehensively discussed in the next update of this article, which will hopefully be ready in a couple of weeks. I am publishing this semi-documented and not fully-tested code, because I am

Is it not possible to add our own menu items on the CHtmlView context menu?

北慕城南 提交于 2020-03-04 20:50:04
问题 So I keep coming back to this article on CodeProject: https://www.codeproject.com/Articles/4758/How-to-customize-the-context-menus-of-a-WebBrowser I then realised this statement at the top of the article: The revised sample projects are using a new , much better customization approach that is going to be comprehensively discussed in the next update of this article, which will hopefully be ready in a couple of weeks. I am publishing this semi-documented and not fully-tested code, because I am