webbrowser-control

Implement IDownloadManger for my application only

拟墨画扇 提交于 2019-12-21 02:21:11
问题 I'm using the WebBrowser control in a WinForms application and have implemented my own download manager by following the instructions here. My custom download manager works, but also overrides the download manager for Internet Explorer , too*. Is there a way to only have the custom download manager appear when my application is running? Or is there a way to unregistered it when my application closes? *I appreciate that is precisely the point of implementing IDownloadManager , and the

Can I detect errors while using a .Net WebBrowser control?

折月煮酒 提交于 2019-12-20 18:29:27
问题 I have an .Net Froms application that displays web pages through a WebBrowser control. Is there anyway that I can detect if the control shows a ' Page not found ' or ' Cannot display webpage ' error? There doesn't seem to be any error event handlers. 回答1: The WebBrowser windows forms control is wrapper around Internet Explorer and it doesn't expose all the functionality of the underlying ActiveX control and particularly the NavigateError event. Here's a workaround: First add reference to

How to Cleanly Destroy WebBrowser Control

*爱你&永不变心* 提交于 2019-12-20 10:55:49
问题 I am using ATL in VisualC++10 to host browser control. My code is similar to this example: http://msdn.microsoft.com/en-us/library/9d0714y1(v=vs.80).aspx Difference is I have main window and then child window hosts the browser control. After 2 minutes i have to close the browser completely kill the browser activeX but this child window should be alive and do something else. But somehow this browser control still stays there, i can either see scrollbars or something.. I have also tried by

WebBrowser-Control - open default browser on click on link

巧了我就是萌 提交于 2019-12-20 10:55:16
问题 I use the WebBrowser-Control in my WPF-Application like <WebBrowser x:Name="webBrowser" Margin="0,28,0,0" /> Now, when I navigate to a mht-page which contains links and the user click on one of this link, the new page is opened in the WebBrowser-Control. But it should be opened in a new Default-Browser-Window. The content in the WebBrowser-Control should not be changed. Is there a way to change this behavior? 回答1: You can open the new page in default browser using Proces.Start() on Navigating

How should an array be passed to a Javascript function from C#?

我的梦境 提交于 2019-12-20 09:59:05
问题 I use a WebBrowser object from WPF and I'm calling some Javascript code in the page loaded in the browser like this: myWebBrowser.InvokeScript("myJsFunc", new object[] { foo.Text, bar.ToArray<string>()}); Now, the js function is supposed to iterate over the elements of the second parameter (an array of strings) and do stuff accordingly. The only issue is that the parameter seems not to be passed as a js array. For example, alert(typeof theArray); alerts "Unknown". What is the proper way to

Best Way to Render HTML in WinForms application? [closed]

痴心易碎 提交于 2019-12-20 09:02:04
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I have a WinForms application, running on .net 3.5. This Application generates HTML on the fly, which includes the complete document, and also an inline-CSS-Stylesheet (inside the head element). I am using the WebBrowser control and setting browser.DocumentText to my

Difference between F5, CTRL + F5 and click on refresh button?

假装没事ソ 提交于 2019-12-20 08:35:04
问题 Hello I have often experienced while developing my web applications that pressing F5 or refresh doesn't produce or refresh the proper result. But when we hit CTRL + F5 it generates the correct result. What is the basic difference between simple F5 and CTRL + F5 ? I have often also experienced that pressing simple F5 and pressing the refresh button on browser also generate different results. Can any body tell me what is the basic difference among all these requests. 回答1: CTRL + F5 Reloads the

flash player embedded in asp page which is opened in webbrowser control

故事扮演 提交于 2019-12-20 06:43:22
问题 I am developing a windows application in C#.NET. In one of my winform I have added a WebBrowser control. In this webbrowser control I have opened an asp page from my local website. Now in this webpage there is one flash object which is used to play swf files. Now my question is can I access this control from my winform? If so then how? can u create a handler for that flash object? 回答1: You can access the ActiveX's scripting interface from the element via the IHTMLObjectElement::object method.

webBrowser.Document.Write() Irregular Performance

感情迁移 提交于 2019-12-20 06:16:57
问题 I am using a webBrowser control as the main output window for my application. The first time I use document.write(), the text is completely replaced. The second time the text that I am writing is appended to the end. I have confirmed that I am not writing twice or adding strings too many times by accident. Why would the control behave this way? 回答1: Call OpenNew before writing the document. HtmlDocument doc = webBrowser1.Document.OpenNew(true); doc.Write("<HTML><BODY>This is a new HTML

Size WPF Browser to its HTML-Content

和自甴很熟 提交于 2019-12-20 04:13:51
问题 I want to show my Flair in a WPF Browser Control and size it to the smallest size possible. XAML: <Window x:Class="TestProject.MainWindow" [...] Title="MainWindow" MaxHeight="500" MaxWidth="500" Loaded="Window_Loaded" SizeToContent="WidthAndHeight" Height="86.453" Width="163.44"> <Grid> <WebBrowser x:Name="browser"></WebBrowser> </Grid> Here is my Code-Behind: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private string CreateHTML() { StringBuilder