webbrowser-control

screenshot of a winforms control through C#

…衆ロ難τιáo~ 提交于 2019-12-18 04:22:20
问题 Is it possible to get a screenshot of a control in winforms without actually displaying it on the screen? How about a webBrowser component? 回答1: Yes. This can be done. I whipped up a sample program to do it. Forgive my naming conventions and code organization, this was whipped up very quickly. You can modify it to better fit your needs, but this shows the basics. I have a single form with three controls: button1: Button with the default settings. button2: Button with the Visible property set

How to open a link in webBrowser control in external browser?

江枫思渺然 提交于 2019-12-18 03:54:22
问题 I have a textBox and a webBrowser control in my Windows Forms application. Whenever a user enters a HTML code in textBox, the webBrowser control shows its compiled form. The code for this: private void textBox2_TextChanged(object sender, EventArgs e) { webBrowser1.DocumentText = textBox2.Text; } But whenever I click a link in the webBrowser control, it opens it in the same webBrowser control. What I want is that it should open in default web browser of the system. So is there any event for

How to open a link in webBrowser control in external browser?

两盒软妹~` 提交于 2019-12-18 03:54:10
问题 I have a textBox and a webBrowser control in my Windows Forms application. Whenever a user enters a HTML code in textBox, the webBrowser control shows its compiled form. The code for this: private void textBox2_TextChanged(object sender, EventArgs e) { webBrowser1.DocumentText = textBox2.Text; } But whenever I click a link in the webBrowser control, it opens it in the same webBrowser control. What I want is that it should open in default web browser of the system. So is there any event for

How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control?

末鹿安然 提交于 2019-12-17 23:25:30
问题 I am trying to load a PDF document inside a .NET web browser control. In versions of Adobe Reader prior to v10 (aka "X"), the PDF loaded without the toolbar displayed—you would just see the PDF document. In the newly-released Reader v10, there is a toolbar that I do not wish to see. I am wondering if anyone knows how to hide this toolbar. I'm thinking that the answer may lie in the Registry, as there is no direct code that I am using to access Reader. Everything is handled by mime types

Webbrowser control handling javascript: popup

感情迁移 提交于 2019-12-17 19:54:22
问题 My software handles navigation to target=_new through this function Private Sub Web1_NewWindow(...) Handles Web1.NewWindow Web1.Navigate(Web1.StatusText) e.Cancel = True End Sub Which allows me to open any new windows inside the same webbrowser control. However, when navigating to a "javascript:" link that creates a new popup, I get the following message because it is trying to navigate to that page: The requested resource is in use. (Exception from HRESULT: 0x800700AA) How can I make it open

C# WebBrowser PanningMode

橙三吉。 提交于 2019-12-17 19:53:33
问题 I'm working on a WinForms application that is implementing a C# WebBrowser control. This application is deploying to a Windows 7 SP1 Panasonic touch screen device. Many times, the user will be browsing a page containing a very large image. In order to see parts of this image, they will need to scroll horizontally. While the vertical scrolling via finger is fine, horizontal scrolling is very uncooperative. I see we have ScrollViewer.SetPanningMode, but do we have something similar for the

TWebBrowser crashes with embedded Youtube clips

杀马特。学长 韩版系。学妹 提交于 2019-12-17 19:47:42
问题 Here is my code: type TForm1 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); end; implementation uses ActiveX; procedure TForm1.Button1Click(Sender: TObject); // method 1 var HtmlFile: string; begin HtmlFile := ExtractFilePath(Application.ExeName) + 'test.html'; WebBrowser1.Navigate(HtmlFile); end; procedure LoadHtml(wb: TWebBrowser; HTMLStr: string); var aStream: TMemoryStream;

WebBrowser control, isolation and IE8 InPrivate mode

让人想犯罪 __ 提交于 2019-12-17 18:59:00
问题 I have a need to run some automation tasks in a web browser control but I seem to be facing a few limitations/unknowns that I'm not 100% sure how to resolve. The application I'm running is not for public release, so I can enforce a prerequisite that IE8 is installed. GeckoFX (http://geckofx.org) would be great except it does not offer me an acceptable way to manipulate the DOM as I would using the WebBrowser's InvokeMember method on HtmlElement objects. WebKit.net would be even better but it

Run and control browser control in different thread

蹲街弑〆低调 提交于 2019-12-17 17:16:00
问题 I have my main gui class with some subclassess. There are +- 3 threads that are collecting data from various internet sources and API gateways etc. Now, out of one of these threads, I want to run a webbrowser control, so I can add some autobrowsing functionality to my program. Each of the sub threads should be capable of opening a webbrowser on its own. So I created a second c# windows form, which contains only the webbrowsing control. I already use the ApartmentState.STA setting on this new

Webbrowser behaviour issues

做~自己de王妃 提交于 2019-12-17 16:53:46
问题 I am trying to automate Webbrowser with .NET C#. The issue is that the control or should I say IE browser behaves strange on different computers. For example, I am clickin on link and fillup a Ajax popup form on 1st computer like this, without any error: private void btn_Start_Click(object sender, RoutedEventArgs e) { webbrowserIE.Navigate("http://www.test.com/"); webbrowserIE.DocumentCompleted += fillup_LoadCompleted; } void fillup_LoadCompleted(object sender, System.Windows.Forms