webbrowser-control

Mono Winforms MacOSX replacement for WebBrowser

為{幸葍}努か 提交于 2019-12-10 16:37:36
问题 I'm one step away from having my Windows .Net application working on Mac OS X, and the last thing I need to figure out is the WebBrowser control. I need to display a webpage and not much more with winforms but haven't been able to find any examples or information on how I can replace the WebBrowser control on Mac OS X Has anyone already found a solution for a web control replacement using winforms on mac os x, and can point me to some source code or talk me through it? 回答1: Apparently there

Can the CKEditor be used in a WinForms application for (X)HTML editing?

北慕城南 提交于 2019-12-10 15:59:27
问题 I have adapted the code from winforms html editor to C# (see below). Is it possible to use the CKEditor instead? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WebEditorTest { /// <summary> /// https://stackoverflow.com/questions/214124/winforms-html-editor /// </summary> public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Detect scroll on a WebBrowser control

。_饼干妹妹 提交于 2019-12-10 15:47:29
问题 I have the following code that, weirdly, works for a couple of seconds and then stops working (my event handler method stops being called): public partial class Form1 : Form { private void Form1_Load(object sender, EventArgs e) { webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted); webBrowser1.Navigate("google.com"); } private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (!webBrowser1

How to distinguish between a user clicking a link and the page doing an automatic redirect?

Deadly 提交于 2019-12-10 14:19:42
问题 Having a C# WebBrowser control inside my WinForms application, and being aware of the Navigating event, I never came up with a nice and elegant solution to the following: If a user actively navigates to another URL, I want to allow it. If the page redirects "on its own" to another URL, I want to cancel it. For case 1 there are some cases I can think of: User clicks an a tag and the href attribute is evaluated to load another URL. User clicks on an element with an onclick javascript event

WebBrowser “steals” KeyDown events from my form

房东的猫 提交于 2019-12-10 14:04:11
问题 I have a WebBwoser inside a Form , and I want to capture the Ctrl+O key combination to use as a shortcut for a menu item. My problem is that if I click on the WebBrowser and I press Ctrl+O, an Internet Explorer dialog pops up, instead of doing what my menu item does. I have my Form 's KeyPreview property set to true . Also, I added an event handler for the KeyDown event, but it stops getting called after I click the WebBrowser . How can I fix this? 回答1: This should solve your problem. It

Is there a WebDriver Navigated event?

北战南征 提交于 2019-12-10 13:41:19
问题 The .NET WebBrowser has a Navigated event. Is there a similar event for the Selenium WebDriver? I've searched but have not found anything. 回答1: WebDriver.Support library contains an EventFiringWebDriver wrapper for the IWebDriver interface. That wrapper provides the Navigated event you are looking for. IWebDriver yourDriver; ... EventFiringWebDriver eventDriver = new EventFiringWebDriver(yourDriver); eventDriver.Navigated += navigatedHandler; 来源: https://stackoverflow.com/questions/26156313

Firing WebBrowser.DocumentCompleted event whilst in a loop

你说的曾经没有我的故事 提交于 2019-12-10 11:48:17
问题 I have a simple app I am developing that needs to iterate through a list of URLs which are passed to a WebBrowsers Navigate function in a for each loop. I was hoping to see the DocumentCompleted event firing after each call of the Navigate function but it only seems to be fired after the whole form has completed loading - and this the loop has completed. I guess I am missing something fundamental here but some help and advice would be great! Thanks! Here is a sample of code that I am trying..

Set System.Windows.Controls.WebBrowser's content to a static HTML literal?

最后都变了- 提交于 2019-12-10 10:59:59
问题 I want to set up inline content of a WPF WebBrowser control: <WebBrowser> <html> <body><b>Inline content.</b></body> </html> </WebBrowser> Or alternatively: Dim wb As New WebBrowser wb.Content = "<html><body><b>Programmatic content</b></body></html>" 回答1: Call NavigateToString or NavigateToStream: wb.NavigateToString("<html><body><b>Programmatic content</b></body></html>"); Yeah, they are badly named. 来源: https://stackoverflow.com/questions/1598030/set-system-windows-controls-webbrowsers

Get HTML source code from browser control embedded in C#

假装没事ソ 提交于 2019-12-10 10:59:37
问题 I have a browser control embeded in a C# windows app. I want to grab the rendered HTML (which could have been modified by javascript) not the original one. Any suggestions? 回答1: You can get the HTML, and indeed set it, with WebBrowser.DocumentText. Sheng is correct, DocumentText returns the streamed document before scripts run. His code doesn't compile, but it's essentially correct. I found that you need: mshtml.HTMLDocument doc = webBrowser1.Document.DomDocument as mshtml.HTMLDocument;

Retrieving Selected Text from Webbrowser control in Windows phone 7

和自甴很熟 提交于 2019-12-10 10:57:47
问题 I am trying to Retrieve selected text from Webbrowser control in Windows phone 7 when it is selected using Tap. Also want to remove the Copy icon when you select the Text. When on Hold Tapping I want to confirm that webbrowser control has any selected text. How could i place a check there. Also i want to Highlight the Selected Text in Webbrowser Control. So problem here is to identify the start and stop of Selected text. I appreciate any help or resources regarding this. Thanks 回答1: By