webbrowser-control

How to fill a WebForm and click the submit Button with a WebBrowser control?

半世苍凉 提交于 2020-12-13 03:20:35
问题 How can I click this SUBMIT button using a WebBrowser control? I've tried with: For Each divSect As HtmlElement In WebBrowser1.Document.GetElementsByTagName("button") If divSect.OuterHtml.Contains("Accedi") Then For Each elem As HtmlElement In divSect.Children If elem.GetAttribute("type") = "button" Then elem.InvokeMember("click") End If Next End If Next but it doesn't return anything. 回答1: Here's a sample procedure to perform a WebForm LogIn using a WebBrowser control. ► Note : I suggest to

C# webBrowser script error

核能气质少年 提交于 2020-08-22 14:26:50
问题 I keep getting a script error when trying to load the page using webBrowser.Navigate("https://home.nest.com/") . It will pull up fine from my normal internet browser but not in my program. Can anyone point me in the right direction? 回答1: The script errors happen all of the time in the integrated Internet Explorer WebBrowser control even when it's using version 11. Modern websites rely heavily on massive Javascript files and dynamic rendering. You can see that just by watching that page load

How to ignore accelerator chars in TWebBrowser (design mode)

痴心易碎 提交于 2020-07-22 05:59:05
问题 I have essentially the same problem like the one described in this question: How to make TWebBrowser ignore accelerator chars of others controls? So the TWebBrowser is in design mode and accelerator keys from TAction are executing associated action. The solution was: type TWebBrowser = class(SHDocVw.TWebBrowser) procedure CNChar(var Message: TWMChar); message CN_CHAR; end; ... procedure TWebBrowser.CNChar(var Message: TWMChar); begin Message.Result := 0; end; I'd like to try the solution

How do I detect when the content of a WebBrowser control has changed (in design mode)?

生来就可爱ヽ(ⅴ<●) 提交于 2020-06-25 19:04:28
问题 I'm using a WebBrowser control in design mode. webBrowser1.DocumentText = "<html><body></body></html>"; doc = webBrowser1.Document.DomDocument as IHTMLDocument2; doc.designMode = "On"; I have a save button that I would like to enable or disable depending on whether the contents of the control have changed. I also need to know when the contents of the control have changed as I need to stop the user from navigating away from the control without accepting a confirmation message box stating that

CHtmlView that is compatible with UltraHD

我的未来我决定 提交于 2020-06-25 05:39:46
问题 CHtmlView is not compatible with UltraHD resolutions. It is not simply down to using the correct HTML/CSS to be UltraHD aware. The print preview mechanism fails and crops the page. Many months ago Microsoft acknowledged this as an issue and has not addressed it. My application heavily uses a CHtmlView element for displaying schedules and printing. Whilst my application is Windows based (Win32/x64) I am getting more and more users on Mac computers running Windows inside it and they all are

wpf: change font size for WebBrowser control

你。 提交于 2020-06-18 11:58:45
问题 How to do this? 回答1: public IHTMLDocument2 Document { get { return webBrowser.Document as IHTMLDocument2; } } ... Document.execCommand("FontSize", false, doubleValue.ToString()) This shold help 回答2: Right way for WPF: using mshtml; //reference to COM object "Microsoft HTML Object Library" ... var doc = web.Document as HTMLDocument; if (doc != null) { doc.execCommand("SelectAll", false, null); doc.execCommand("FontSize", false, 5); doc.execCommand("Unselect", false, null); } additional