webbrowser-control

Retrieving Selected Text from Webbrowser control in .net(C#)

I've been trying to figure out how to retrieve the text selected by the user in my webbrowser control and have had no luck after digging through msdn and other resources, So I was wondering if there is a way to actually do this. Maybe I simply missed something. I appreciate any help or resources regarding this. Thanks ...

System.Windows.Forms.WebBrowser.Refresh showing previous page

My WinForms application has a tab with a System.Windows.Forms.WebBrowser control. There are several controls that set the WebBrowser's .Url property, and when the form repaints it calls the WebBrowser's .Refresh(WebBrowserRefreshOption.Completely) method. Occasionally, however, the form gets repainted and the WebBrowser content doesn't ...

Retrieve Selected Text from a Web Browser Control in a

Here's what I am trying to do: Select text from a webpage I pulled up using my web browser control. After clicking a button while this text is still selected I would like a message box to pop-up displaying the text that was highlighted by the user. I do I get this functionality to work in my wpf application? I think I'm on the right tra...

MSHTML: How can you clear the undo / redo buffer of MSHTML

I'm using a C# wrapper control similar to the WebBrowser control that contains the COM / unmanaged MSHTML control. I'm using this control in the edit mode which allows the user of the application to edit a a HTML document in a WYSIWYG manner. This control manages it's own undo / redo stack. How can I reset / clear it so that user will ...

How do I get a C# WebBrowser control to show jpeg files (raw)?

Hi. Does anyone know in .Net 2.0 - .Net 3.5 how to load a jpeg into a System.Windows.Forms.WebControl as a byte-array and with the right mimetypes set so it will show? Something like: webBrowser1.DocumentStream = new MemoryStream(File.ReadAllBytes("mypic.jpg")); webBrowser1.DocumentType = "application/jpeg"; The webBrowser1.DocumentT...

WinForms - How do I execute C# application code from inside WebBrowser control?

I have a form containing a web browser control. This browser control will load some HTML from disk and display it. I want to be able to have a button in the HTML access C# code in my form. For example, a button in the HTML might call the Close() method on the form. Target platform: C# and Windows Forms (any version) ...

What the best way to print the contents of the WPF web browser?

We use a modified version of the IE engine (the COM version in a C# wrapper) to display a lot of the formatted content in our application. The problem, however, is you don't have a lot of control of any printout of such documents. For example, you can't force a color printout without accessing the registry or directing the user to thei...

Using jQuery in WinForms desktop app?

We have a WinForms desktop application that uses the .NET 2.0 framework WebBrowser control quite extensively for displaying HTML. The HTML may be simple, or quite complicated. It may reside on disk, or it may be written directly to the document property at runtime. I was wondering if anyone had any experience with using jQuery as a lib...

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

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. ...

How to disable click sound in WebBrowser Control

I use Javascript to click a link in the webbrowser control. But I don't want to hear IE's "click" sound. Is there anyway to do this? P.S. I don't want to change system settings. I've seen this one(http://stackoverflow.com/questions/10456/howto-disable-webbrowser-click-sound-in-your-app-only) but Document.Write is not an option for ...

How to move carret position to end of current word?

I'm using a webbrowser control. How can I move the insert position for an execCommand to the end of the word, that is currently selected? Example: | <- current carret position Som|eword -> move -> Someword| -> execCommand executes after current word What I want to do is insert a line without braking the word. What happens now is: ...

How to set current document.domain in WebBrowser Control to avoid "Access is denied"?

How can I set current document.domain in WebBrowser Control to avoid "Access is denied" in Cross-domain calls (XMLHTTP Requests or Iframe/frame access)? I've tried CurrentDocument = WebBrowserControl.Document CurrentDocument.domain = "example.com" Console.writeline("xx" & CurrentDocument.domain) This doesn't work, somehow it never r...

Implementing IHttpSecurity in .NET (managed code)

How can I implement IHttpSecurity for Webbrowser Control in .NET? I couldn't find any examples, all examples are in C++, also MSDN documentation is only for C++ ...

Is AxBrowser.GetOcx() is equal to Webbrowser.ActiveXInstance() ?

I'm trying to understand the different between .NET 2.0+ provided Webbrowser Control and AxWebBrowser. As far as I understand AxWebBrowser is a COM object and Webbrowser Control is just managed wrapper around AxBrowser. Am I right? Is AxBrowser.GetOcx() is equal to Webbrowser.ActiveXInstance() almost same? ...

How to carry out Cross Domain request in a Webbrowser Control?

As you know doing Cross Domain XMLHTTP requests is not allowed for security reasons under Internet Explorer. I have a WebBrowser Control and I'm using DocumentText instead of Navigate to a URL. Since the current domain is about:blank when the page tries to do a request to itself or other domain I'm getting Access is denied Javascript er...

How to get dialog result from WebBrowser.ShowPageSetupDialog

I'm using a WebBrowser control in my Visual C# (.net 2.0) application. Now I'd like to add a print button which shows the page setup dialog and then directly prints when the user presses the OK button or cancels the printing when the user presses the cancel button. However WebBrowser.ShowPageSetupDialog doesn't return DialogResult, but j...

WebBrowser control: How to overwrite URL property

This is a bit special: I'm loading some HTML in string form into the WebBrowser control via the DocumentText property. Now when I print the page with a PDF printer (Bullzip PDF Printer in my case) it always takes the URL as document name which is "about:blank". Is there any way to change this to another value by either changing the URL p...

Implementing IInternetZoneManager in .NET

I'm trying to implement IInternetZoneManager in .NET with Webbrowser Control but I have no clue what to do. I couldn't find any managed code example about this implementation. I'm pretty bad about OLE stuff. Can anyone provide a sample on this? I spend about 2 days with no luck. ...

How to clear System.Windows.Forms.WebBrowser session data?

How can I clear current session data (cookies, cached data, auth sessions, etc) without restarting the application? Update: I'm talking about WebBrowser control in Windows.Forms, not the ASP.Net session. ...

How do I detect if jQuery is in a document navigated to in the WinForm WebBrowser control?

I have a Windows Forms application in C#/Visual Studio 2008 with an IE WebBrowser control. In the DocumentCompleted event, I want to search the WebBrowser.Document or WebBrowser.DomDocument to see if jQuery is already present in the page. What's a good way to accomplish this? Thanks! ...