webbrowser-control

WebBrowser keyboard shortcuts

こ雲淡風輕ζ 提交于 2019-11-30 13:28:15
问题 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

Prevent scrollbars with WPF WebBrowser displaying content

点点圈 提交于 2019-11-30 12:59:25
I'm using the WPF WebBrowser component to display some very simple HTML content. However, since I don't know the content size in advance, I'm currently getting scrollbars on the control when I load certain datasets. Basically, how can I force (or otherwise effect the equivalent of forcing) the WebBrowser to expand in size so that all content is displayed without the need for scrollbars? I guess you can get width and height of the webbrowser component content through its Document property which should be of mshtml.HTMLDocument type. I believe you should be able to use body or documentElement

Controlling Browser using Python?

喜你入骨 提交于 2019-11-30 11:56:08
问题 Is it possible to control a web browser like Firefox using Python? I would want to do things like launch the browser force clicks on URLs take screenshots etc. 回答1: Selenium Remote Control is a project that comes very close to what you are after. It is really easy to get working in Python with the selenium.webdriver subpackage that comes with it. Once upon a time, these were two projects. They've now been unified. Installation Simple! $ pip install -U selenium Usage >>> from selenium import

How to call WebBrowser Navigate to go through a number of urls?

久未见 提交于 2019-11-30 10:36:39
To collect information on a webpage, I can use the WebBrowser.Navigated event. First, navigate to the url: WebBrowser wbCourseOverview = new WebBrowser(); wbCourseOverview.ScriptErrorsSuppressed = true; wbCourseOverview.Navigate(url); wbCourseOverview.Navigated += wbCourseOverview_Navigated; Then process the webpage when Navigated is called: void wbCourseOverview_Navigated(object sender, WebBrowserNavigatedEventArgs e) { //Find the control and invoke "Click" event... } The difficult part comes when I try to go through a string array of urls. foreach (var u in courseUrls) { WebBrowser

How to clear browsing history using WebBrowser control in C#

99封情书 提交于 2019-11-30 10:11:19
问题 I want to clear the browsing history of a WebBrowser control in C# after the WebBrowser completes its browsing. This is my code: try { foreach (string sr in File.ReadAllLines("link.txt")) { webBrowser1.Navigate(sr); webBrowser1.ScriptErrorsSuppressed = true; } while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } } catch(Exception) { MessageBox.Show("Internet Connection not found","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); this.Close(); } 回答1:

How to embed a web browser control in a cross-platform application?

不羁岁月 提交于 2019-11-30 09:41:57
I need to write quickly this application: a simple window that wraps a web browser control, that runs html pages. The Browser UI (e.g. Navigation buttons) should be suppressed. As a .net developer, I would embed the WebBrowser OCX in a Windows Form. But this has to run on Mac as well! I found the following cross-platform candidates. Which one would you choose (in terms of simplicity, stableness, community support, etc.): wxWidgets: http://www.kirix.com/labs/wxwebconnect.html QT: http://www.youtube.com/watch?v=Ee8eRwjbcFk&feature=related MONO: http://www.mono-project.com/WebBrowser Why not to

Handling key events on WebBrowser control

心已入冬 提交于 2019-11-30 09:33:19
I am using the WebBrowser control in a C# application and want to handle all key events while the WebBrowser has the focus, regardless what individual content element (input field, link, etc.) is focused. I tried to simply add an event handler to browser controls KeyDown event, but this does not work. I don't want to explicitly hook a handler to each focusable HtmlElement . How can I receive all key events before they are passed to the browser or its content elements? you have the PreviewKeyDown event just hook it up. private void wb_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { /

OLE Container for .NET

无人久伴 提交于 2019-11-30 09:20:40
问题 I'm working on a project that requires me to load an OLE object and render it in a .NET WinForm app (C#). Unlike VB6 .NET has no built in OLE container, and the recommended approach is to use the WebBrowser control which supports displaying ActiveX content. The issue I have is the provider of the OLE object in question does not have an ActiveX control available. Simply put is there any way to load an OLE object onto a WinForm? Or will I need to write an ActiveX control that loads the OLE

How to force Web Browser control to always open web page in the same window?

走远了吗. 提交于 2019-11-30 09:07:49
I need to use web browser in my application as it keeps repetitive tasks from employees, but there is a problem with javascript that opens a new window in IE after clicking on anchor. How do I tell web browser control to "open new window" where I want it to be opened? For example in the other web browser control? Check out: proof-of-concept of .NET System.Windows.Forms.WebBrowser module using source code My experience about that controls has given me a vision that this issue can tried to be solved in next steps: always cancel NewWindow event catch all links clicking but not all link can be

how to apply custom font to web browser content WP7

荒凉一梦 提交于 2019-11-30 09:07:27
问题 Am developing simple app for learning webBrowser concept in Windows phone. My aim is to display the content in Telugu(Indian language) in my WP7. that web application is displaying Telugu content only my MainPage.xaml.cs code is : private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { webBrowser1.Navigate(new Uri("http://www.eenadu.net", UriKind.Absolute)); } in MainPage.xaml file <phone:WebBrowser HorizontalAlignment="Left" Margin="0,92,0,0" Name="webBrowser1"