webbrowser-control

WebBrowser control as User Interface

不想你离开。 提交于 2019-12-03 18:09:38
问题 First a few definitions to keep things clear. User: A live person, using the software Client: A company that is paying for a customized version of our software for their users. We currently have a few applications that are going to require significant changes in the user interface based on which client the user belongs to. We currently have a separate build for each client, but as the number of clients increase, it's becoming more of a pain to manage all of those separate releases. My goal is

How to Highlight a specific word in WebBrowser control C#

穿精又带淫゛_ 提交于 2019-12-03 17:44:14
问题 I have a webbrowser control and I am able to get the selected word by the user. I am saving this word in a file and with it I am also saving its byte offset and length. Lets says i have some text in my Web browser control as "Hello Hey Hello" lets say the user has selected last hello. Now that word is saved with me along with other info like its length etc. I need to provide a feature to highlight the selected word when the user reloads the file and sends me that word along with its length

WPF rendering problem with HWND children in the way

狂风中的少年 提交于 2019-12-03 17:21:56
I suppose it is safe to say that WPF renders its contents as a window background. There are no child windows in a traditional HWND sense. So, when one introduces something HWND based in a WPF app, like a WebBrowser, things start to go wrong way it terms of visual appearance. Consider a Window having a Grid with two children, WebBrowser and something else, e.g. TextBox. If WebBrowser were a red circle instead, the TextBox would render on top of it. In case of WebBrowser, no TextBox is to be found anywhere. This is because TextBox is rendered as main window's background and WebBrowser is

Detecting external content with TEmbeddedWB or TWebBrowser

依然范特西╮ 提交于 2019-12-03 16:37:17
I am trying to block anything external loaded by TEmbeddedWB or TWebBrowser (or TCppWebBrowser). I would like to block anything that is loaded from Internet including images, javascript, external CSS, external [embed] or [object] or [applet] or [frame] or [iframe], executing JavaScript that can load external content etc. This problem consists of 2 parts: putting web browser into "restrict all" (except basic HTML without images) and detecting if such content exists if external content is not present ok, if it is, showing a "download bar" which after click puts web browser into "download all"

Disable scrolling in browser control for WP7?

懵懂的女人 提交于 2019-12-03 16:32:53
Is it possible to disable the scrolling in a web browser control in Windows Phone 7.1? I have seen quite a few questions ask around it (Windows Phone 7.0, Silverlight) but an answer has yet to come up. Any ideas? There is a blog post here explaining how to suppress the zoom and scroll functionality of the WebBrowser control. Quote from that post: The visual tree is quite simple, composed of a few grids and borders. The significant parts are the TileHost, which is the native IE9 component, and the PanZoomContainer. The TileHost does not handle the mouse manipulation events, these are instead

WPF WebBrowser control doesn't enter design mode when the document property is changed

£可爱£侵袭症+ 提交于 2019-12-03 15:55:16
I have a frustrating problem. Here's a simplified version of what I'm doing: A UserControl in c# contains a toolbar and an embedded WebBrowser object. The toolbar contains an "Edit" button, which when clicked sets the webbrowser control in design mode. Another button, "Cancel", turns off design mode. Pseudocode (very simplified): public void SetDesignMode(bool dm) { IHTMLDocument2 doc = webBrowser.Document as IHTMLDocument2; if (dm) doc.designMode = "On"; else doc.designMode = "Off"; _designMode = dm; ReloadDocument(); // setting designmode clears the document element, so it must be reloaded }

WebBrowser Control download file in session

隐身守侯 提交于 2019-12-03 15:30:24
I'm using WebBrowser control to navigate through a login page and download a file. Since I can't find a way to manage the download automatically with the control I'm using the WebClient class to try and achieve this. Problem is that since the WebClient isn't in the same context/session as the browser all i'm downloading is the Security Error screen. Any ideas on how I can pass the context of the WebBrowser session to the WebClient ? Laramie It should be simply a matter of emulating the cookies and headers in the WebBrowser session and re-using them to impersonate the session in WebClient, but

C# WebBrowser control not applying css

别等时光非礼了梦想. 提交于 2019-12-03 12:54:38
I have a project that I am working on in VS2005. I have added a WebBrowser control. I add a basic empty page to the control private const string _basicHtmlForm = "<html> " + "<head> " + "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> " + "<title>Test document</title> " + "<script type='text/javascript'> " + "function ShowAlert(message) { " + " alert(message); " + "} " + "</script> " + "</head> " + "<body><div id='mainDiv'> " + "</div></body> " + "</html> "; private string _defaultFont = "font-family: Arial; font-size:10pt;"; private void LoadWebForm() { try { _webBrowser

How to call javascript inside a WebBrowser control in winforms?

心已入冬 提交于 2019-12-03 12:39:29
I want to call the javascript function 'Goto' like this : javascript:Goto('DM_NEW_OBJECT.ASPX?DM_CAT_ID=2063&DM_PARENT_ID=2217&INPUTSELECTION=&DM_OBJECT_ID=0&PACK_ID=0&CASE_ID=0&mode=0&SITE=Default'); the function is located in the DefaultGeneral.aspx page, and i need to call it from within a WebBrowser control webBrowser1.Navigate("http://mySite/DefaultGeneral.aspx"); Do you have any idea ? Thank you. Since you are using a WebBrowser object, I will assume that this is actually a Windows forms question and not an asp.net question. You should look at the InvokeScript function of the web browser

How to use proxy with C# application

两盒软妹~` 提交于 2019-12-03 10:10:23
问题 I am using Microsoft Visual Studio 2010 C# .net 4.0 I have a webbrowser element. What i want to do is navigating via Webbrowser element with using proxy. How can i do that ? thank you. 回答1: The browser control is just an instance of IE - it will use IE's proxy settings. You can set these by playing with registry keys if you must do it in code. string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; string serverName = "";//your proxy server name; string port = ""; /