webbrowser-control

WebBrowser Control IE8 Compatibility Mode On/Off Switch

余生长醉 提交于 2019-12-19 03:23:26
问题 I am having a IE8 compatibility issue while using the WebBrowser control to navigate to a website. The strange thing is sometimes the website works, but more than likely it wont. I can refresh the page sometimes and it works as well. Just going to the page in IE8 I experienced the same CSS rendering problems so I switched to compatibility mode and it refreshed and rendered correctly. Is there a way to simulate this effect for the WebBrowser control. I want to be able to click a button and

Printing From WebBrowser control prints to wrong printer after setting default

邮差的信 提交于 2019-12-19 03:19:28
问题 I have a WebBrowser control in a VB.NET WinForms app. I am able to set the default printer from code and print without prompting the user. However, there is also a print button that shows the PrintDialog. If this action is done first the page will print. Then if I try to programmatically print later (again setting the default printer to some other printer) the it will print to the last printer selected in the PrintDialog box even though I am resetting the default and see the default printer

Security Level for WebBrowser control

不打扰是莪最后的温柔 提交于 2019-12-19 03:09:48
问题 I am trying to migrate an .hta application to a C# executable. Of course, since it's an .hta the code is all HTML and Jscript , with calls to local ActiveX objects. I created a C# executable project and am just using the WebBrowser control to display the HTML content. Simply renamed the .hta to an .html and took out the HTA declarations. Everything works great, except that when I make calls to the ActiveX objects, I get a security popup warning of running an ActiveX control on the page. I

WebBrowser Control - Console Application - Events Not Firing

岁酱吖の 提交于 2019-12-18 18:30:23
问题 I have been navigating the various WebBrowser control stackoverflow questions, and I can't seem to find an answer to a problem I am having. I am trying to use the WebBrowser control to print a web page. Following MSDN's example, I have created the following console application: namespace WebPrintingMadness { using System; using System.Collections.Generic; using System.Text; /// <summary> /// The entry point of the program. /// </summary> class Program { /// <summary> /// The main entry point

Confirm box before closing a tab

谁说胖子不能爱 提交于 2019-12-18 17:32:45
问题 I want to have a confirm box when user tries to close the window. window.onbeforeunload = function (evt) { var message = 'Are you sure you want to leave, cause there are some unsaved changes?'; if (typeof evt == 'undefined') { evt = window.event; } if (evt) { evt.returnValue = message; } return message; } The thing is I want to check a variables value var sncro = 1; If its value is not equal to one then this confirmation box should be there, else no need to have a confirmation. I'm not able

Use a proxy with webBrowser control C#/.net 3.5

我只是一个虾纸丫 提交于 2019-12-18 16:56:10
问题 I need some help from someone who has already use the webBrowser control along with a proxys. What I need is the following. 1 - Set a proxy for a webBrowser control. 2 - Load a specific site. 3 - Execute a routine over the site. 4 - Set a diferent proxy for the webBrowser control. 5 - Load another site. 6 - Execute the same routine from point number 3. And the process keeps in that way, looping from a list of proxys, until all of them had been used. But. I'm having some problems with the app.

How do I save a web page to image

僤鯓⒐⒋嵵緔 提交于 2019-12-18 12:47:24
问题 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. 回答1: See http://blog.ashmind.com/index.php/2008/09/28/putting-web-snapshots-to-practical-use/ and here is the code:

How does SO's form remember previous input values?

∥☆過路亽.° 提交于 2019-12-18 12:23:19
问题 I've noticed that the Title or Body part is remembered if I come back to the Ask Question page by pressing Back button of my browser. This feature is available in all browsers I tested, but doesn't exist for the forms in my own projects. How can I approach that effect? UPDATE I still don't have any clue yet,but guess it that some kind of client cache enabled by http headers or javascript? 回答1: It has to do with the caching properties of your page. 1) If the browser is allowed to cache your

How to detect Javascript execution in WebBrowser control

此生再无相见时 提交于 2019-12-18 11:48:10
问题 I have a WebBrowser control in my C# application. The web browser is under the user's control, that is, he can load any web page his computer can access on the web (of course limited by proxy, hosts file and so on). I need to know and to be notified when there is a Javascript call inside the page loaded in the web browser component. First example: given a link like this <a href="javascript:void(0)" onclick="jsFunct();">test</a> When the user clicks the link I need to know that the function

Clear web browser cookies winforms C#

一个人想着一个人 提交于 2019-12-18 09:38:42
问题 How I can clear cookies for web browser control winforms C# , is there any way to clear cookies problematically in winforms web browser control 回答1: You can disable cache (including cookies) before navigating to the site. To do so, you can use InternetSetOption API function and set the value of INTERNET_OPTION_SUPPRESS_BEHAVIOR(81) option to INTERNET_SUPPRESS_COOKIE_PERSIST(3) value. Example The following example, works like starting a new session. While I've logged in to the outlook.com on