webbrowser-control

WebBrowser.Document property getter throws UnauthorizedAccessException

感情迁移 提交于 2019-12-11 17:59:26
问题 We have a Windows Forms app that hosts a web application from http://localhost (on a port selected at runtime) in a WebBrowser control which mostly works fine. Within the webapp there is a 'help' link that pops up a new window, and we handle this by listening to the NewWindow event and showing the help URL in another WebBrowser control within another Form/Window, this also mostly works fine. The problem is that the html help files are generating script errors which cause annoying popup error

How do I click an ASP.NET webform's button when the page is hosted in a WebBrowser Control

≡放荡痞女 提交于 2019-12-11 17:11:39
问题 I have a standard ASP.NET web form in a web page, and this page is hosted in a .NET Winform with a WebBrowser Control. Using c# how do I control the WebBrowser Control to submit the ASP.NET form? (eg somehow "clicking" on the button from the Winform?) Update : to complicate things we have the ASP.NET validators which seem to make simple document.forms(0).submit() not work 回答1: I answered a similar question. Check this : simulate Web Page keystroke You can use the following code WebBrowser1

WebBrowser get page size

萝らか妹 提交于 2019-12-11 15:14:57
问题 When working with WebBrowser on IE 9 and above the property webBrowser.Document.Body.ScrollRectangle.Size returns always 250 x 250 as body dimensions. Therefore I can't come across a way to check the current page size. How can I check a html page actual size using IE 9 and above? 回答1: This should get you the window size webBrowser.Document.Window.Size 回答2: I've found a solution that seemed to work all the time until now. I hope it'll help people with the same problem as I do, as you might

CHtmlView class and focus

╄→гoц情女王★ 提交于 2019-12-11 14:25:03
问题 I am having Dialog Box Application written in MFC. Dialog is having 3 child controls on it. 2 Buttons (Button 1 & Button 2) and a HTML Control (Class derived from CHtmlView) HTML Control has been navigated to a HTML page having 2 checkboxes (Check Box 1 & Check Box 2). Control Z-Order for focus should be like: Button 1 Button 2 HTML Control then again Button 1 When focus goes to HTML Control. I want it to set to Check Box 1 & then after pressing tab it will be set to Check Box 2. But When I

Webbrowser click on link with OnClick attribute

一曲冷凌霜 提交于 2019-12-11 12:58:45
问题 Let's say that I've got the following HTML: <div id="active_server"> <div class="clearfix"> <a href="#" onclick="return Index.submit_login('server_nlp1');"> <span class="world_button_active">Server NL P1</span> </a> <a href="#" onclick="return Index.submit_login('server_nlp2');"> <span class="world_button_active">Server NL P2</span> </a> </div> </div> Now let's say that i want to simulate an click on server NL P2. I know that I've got to get the HTML. so first i get the div like this:

Issue With WPF WebBrowser Control When Emulation > IE7

烂漫一生 提交于 2019-12-11 12:52:59
问题 I have a C#/WPF application that uses a WebBrowser control that presents a website as it's primary interface (for a kiosk). The website can call a C# method via javascript for some native processing. Everything works fine until I set the 'FEATURE_BROWSER_EMULATION' above IE7 (using the code below). When I do the javascript call to the native method does not get called unless I run the website from 'http://localhost' which works fine. I'm assuming this is a security issue. I've messed with all

Communication between HTML in WebBrowser and windows phone app

 ̄綄美尐妖づ 提交于 2019-12-11 11:37:34
问题 I have some static html files downloaded into Isolated store. I am trying to open those files using Web Browser control inside windows phone app. Now every HTML file will communicate with back-end code through javascript, and window.external.notify() is not able to apply for all html pages. So my question is, Is there any API like (in iOS) WebViewJavascriptBridge and GAJavaScript or like (android) Javascript Interface available for windows phone 8 which will communicate with HTML in

WebBrowser control doesn't display the Pdf file into the winform with Adobe. Why?

旧时模样 提交于 2019-12-11 11:32:14
问题 Here's my code to open the pdf file into the webBrowser control: private void Form1_Load(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "pdf files (*.pdf) |*.pdf;"; dlg.ShowDialog(); webBrowser1.Navigate(dlg.FileName); } And here's my problem: When I have Foxit Panthom like default pdf reader the pdf is displayed into the webBrowser, but when I set Adobe Reader (I try even with Sumatra Pdf) to default pdf reader the pdf file is displayed into a separated

Wait for WebBrowser DocumentCompleted using AutoResetEvent

纵饮孤独 提交于 2019-12-11 11:25:08
问题 I want my function to wait until the event WebBrowser.DocumentCompleted is completed. I am using AutoResetEvent and here is my code: private static WebBrowser _browser = new WebBrowser(); private static AutoResetEvent _ar = new AutoResetEvent(false); private bool _returnValue = false; public Actions() //constructor { _browser.DocumentCompleted += PageLoaded; } public bool MyFunction() { _browser.Navigate("https://www.somesite.org/"); _ar.WaitOne(); // wait until receiving the signal, _ar.Set(

ol3 with IE11 in a c# webbrowser control mouse click events not working

[亡魂溺海] 提交于 2019-12-11 10:11:53
问题 I've "upgraded" to IE 11 for the browser inside a c# application using the webbrowser control. When I load my web page into the IE 11 browser natively everything works properly on the map. When I'm in the c# application everything loads without error except that I can not click on the map and drag it. All of my map click events will also not fire. I can use the arrow keys to move the map, and the wheel mouse also works. I have noticed that when I use IE 11 natively, and use the developer