webbrowser-control

IE 11 WebGL performance slow when using WebBrowser control

≡放荡痞女 提交于 2019-11-30 09:00:45
I'm trying to embed Cesium in a WebBrowser control inside of a WinForms or WPF application (using IE 11). As a test I'm using this link: http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html?stats=true It "works" but is much much slower than using IE 11 directly. In IE 11, everything runs at 60fps; in a simple WPF or WinForms app with the WebBrowser control it runs at 4-6 fps. I've been unable to track down the cause of the problem. This is with a blank Form or WPF Panel with the WebBrowser control set to fill the entire pane. There's no transparency or other issues that I can imagine.

How to set Paper Size and Margins printing from a web browser control

北城余情 提交于 2019-11-30 08:38:55
问题 I am trying to print from a web browser control in a winform application.The matter is it sets letter as default paper size but I need A4 . Also it automatically sets some margins wrong, I can set them to correct settings manually but I want to do it programmatically. How is it possible? Here is my code to print. private void metroButton1_Click(object sender, EventArgs e) { loadprintData(); // Create a WebBrowser instance. WebBrowser webBrowserForPrinting = new WebBrowser(); // Add an event

Browser Console for AOL Desktop?

假装没事ソ 提交于 2019-11-30 08:37:11
问题 I participate in development of a site that has a significant number of users who view our site through the AOL Desktop v9.7 for Windows - which spawns browser windows inside itself. When debugging, I don't have the tooling I would normally be able to invoke (for example Chrome's Developer Console ; Firebug; MSIE's F12 developer tools ). When inside AOL Desktop, I don't appear to have any of these, or anything similar. Is there a developer mode or console I can invoke, unearth? 回答1: What I

How can you programmatically detect if javascript is enabled/disabled in a Windows Desktop Application? (WebBrowser Control)

有些话、适合烂在心里 提交于 2019-11-30 08:26:11
问题 I have an application which writes HTML to a WebBrowser control in a .NET winforms application. I want to detect somehow programatically if the Internet Settings have Javascript (or Active Scripting rather) disabled. I'm guessing you need to use something like WMI to query the IE Security Settings. EDIT #1: It's important I know if javascript is enabled prior to displaying the HTML so solutions which modify the DOM to display a warning or that use tags are not applicable in my particular case

WebBrowser control page load error

♀尐吖头ヾ 提交于 2019-11-30 08:06:21
问题 I have WebBrowser control on my winform. When I try navigate to some web-site I get standard IE error pages like: "Navigation to the webpage was canceled" "The address is not valid" "Page couldn't be loaded" etc. I need to handle these errors and return custom error message to user. Is there any way to solve this issue? 回答1: You want to handle the NavigateError event as shown here Edit: including example code from the link: using System; using System.Windows.Forms; using System.Runtime

WebBrowser Document Completed Event C#

有些话、适合烂在心里 提交于 2019-11-30 07:43:17
Below is the function I use as my browsers' DocumentCompleted event, and also the navBtnClick() method which is responsible for creating the web browser and navigating to a specific url. public void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { MessageBox.Show( ((WebBrowser)sender).Url.ToString() ); } private void navBtnClick(object sender, EventArgs e) { WebBrowser wbrowser = new WebBrowser(); wbrowser.DocumentCompleted +=new WebBrowserDocumentCompletedEventHandler(WebBrowser_DocumentCompleted); wbrowser.Navigate("http://www.google.com"); } Now after

How do I save a web page to image

∥☆過路亽.° 提交于 2019-11-30 07:42:28
I have a WebBrowser control and I want to save the whole page viewed to image (any web page). I tried using IHTMLElementRender interface but it didn't work for all web pages. Maybe I'm doing something wrong because sometimes the snapshot included the scrollers and sometimes it was just partial. Do you have a working example that can save the whole web page to an image? Thanks. See http://blog.ashmind.com/index.php/2008/09/28/putting-web-snapshots-to-practical-use/ and here is the code: http://ashmind-web-ui.googlecode.com/svn/trunk/AshMind.Web.Snapshots/ It should correctly identify the size

WebBrowser keyboard shortcuts

别等时光非礼了梦想. 提交于 2019-11-30 07:08:18
I have a WebBrowser control displaying some HTML. I want the user to be able to copy the entire document, but not do anything else. I've set the IsWebBrowserContextMenuEnabled and WebBrowserShortcutsEnabled properties to false , and I want to handle KeyUp and run some code when the user presses Ctrl+C. How can I do that? The WebBrowser control doesn't support keyboard events. I tried using the form's KeyUp event with KeyPreview , but it didn't fire at all. EDIT : Here's my solution, inspired by Jerb's answer. class CopyableWebBrowser : WebBrowser { public override bool PreProcessMessage(ref

List replies in a winform

眉间皱痕 提交于 2019-11-30 06:04:12
问题 In my C# app I get an xml from a server that contains some replies like in a forum thread (with elements like author, time, body, title, whatever). When I get this xml, I create a new form in which i want to display these replies, and a little text box with an "add reply" button. I'd also like some edit buttons on perhaps my own replies in the reply list displayed in the form. The simplest way that came to my mind to display the replies is to put a web browser control in the form, generate a

What UserAgent is reported by the WebBrowser control?

醉酒当歌 提交于 2019-11-30 05:26:19
Just wondering what browser type the VB.NET reads as when it visits a webpage. For instance on my website it shows a break down of all the different browsers that accessed my site. You don't provide much context to your question, but I assume that you're talking about the User Agent string that's sent when you use the WebBrowser control built into the .NET Framework. Because that control just uses Internet Explorer to render the page, you'll see a User Agent string very similar to what you'd find if you visited the page using IE on the same computer. The IE string generically reports itself as