webbrowser-control

Resizing a Webbrowser control hosted by an Explorer Bar in IE

Hi, I am very new to windows programming so bare with me. I have a custom explorer bar (a band object) that hosts a webbrowser control. I can initialize the WebBrowser control properly and have it display web pages. However, I've noticed that when I resize the explorer bar, the webbrowser control doesn't resize appropriately to the si...

IE automation: How to determine when a user-initiated navigation is taking place / has taken place?

I have an Internet Explorer BHO (in c# .net) and want to identify either when a user initiates a navigation, or when a user-initiated navigation has completed. By user-initiated i mean clicking on a link or similar action. In particular if there are multiple frames in the document being loaded I want to treat them as a single 'navigation...

[VB.NET] What is the best way to display HTML content on a Windows Form?

I want to display an HTML formatted content in my application preferably inside a Web Browser control. I could create an HTML document first and then load it in the Web Browser control, but that is just too clumsy. Is there any way I can load a string that contains HTML code directly into the Web Browser? String = "<b>Hello</b> World" ...

ScreenShot of WebBrowser Control blank on 301/302 redirects

I'm using some code from SmallSharpTools Web Preview to get screen shots of websites but i get a blank screen shot if the url returns a 301/302 redirect. WebBrowser wb = new WebBrowser(); wb.ScrollBarsEnabled = false; wb.Size = new Size(1024, 768); wb.ScriptErrorsSuppressed = true; wb.AllowNavig...

"dynamic" XSLT to feed webbrowser control?

I frequently use HTML output in applications, up to now I've used some simple routines to build an HTML string. I want to try something different now: I want to serialize the data to XML, and provide some XSLT templates to generate the HTML for the webbrowser control. I get that to work statically (slowly digging through writing XSL), b...

.Net WebBrowser Control encapsulating anything else but IE?

We're using SHDocVw.dll for providing a web browser control to some of our users that access our system through a gadget they install on their computers. Now, that control encapsulates IE. Anyone knows of ways to let the users choose what browser to encapsulate? EDIT - Clarifying: I'm interested in being able to encapsulate another brow...

Make hosted WebBrowser control inherit tab background?

I've run into a problem where I can't really find a good, low maintenance solution. We're trying to integrate our hosted ActiveX WebBrowser control in a dialog box with tabs (the native C++ tab control) better, such as having its HTML font use the "Shell Dlg" font, removing the 3D border for the WebBrowser control, and making its backgro...

AccessViolationException with a webbrowser in a windows form

Hello, I have written a basic Windows Form app in C# that has an embedded web browser control. I am navigating to a page to view a camera's feed. The application works fine on Windows XP, but not on Vista. On Vista, I get a AccessViolationException. This seems to be related to Data Execution Prevention. The article at http://jts...

Check browser tabs by JavaScript?

Can I check if host page for a JavaScript is active by the browser's tab in IE7/FF/Opera? Checking other tabs than the page where this JS runs would probably be a security risk though.. My other option is a method I remember by prototype to check if the mouse cursor is active, but it's not that accurate. ...

Caching and re-using tree of HtmlElement objects

I am using the WebBrowser control in my project to display complex HTML documents that are generated/manipulated at runtime. I have noticed that constructing the DOM programmatically from C# by creating HtmlElement objects is about 3x slower than generating an HTML string and passing it to the WebBrowser, which in turn parses it to ge...

Removing HtmlElement objects programmatically using C#

In a WebBrowser control, how do I remove HtmlElement objects? There are no methods in the HtmlElement class to accomplish this. As a workaround, I can create a "dummy" HtmlElement (without inserting it into the HtmlDocument), into which I then insert (via AppendChild) the HtmlElement objects to be removed. This feels like a hack. Is ...

Gecko API for DOM

Does Gecko expose an API for working directly with its DOM? I'm looking for a class like HtmlElement that can be used to build/traverse trees of HTML content. I'm trying to host Gecko as a web browser control in a desktop application, and would prefer a direct API rather than going through COM. Thanks! ...

WebKit API for DOM

Does WebKit expose an API for working directly with its DOM? I'm looking for a class like HtmlElement that can be used to build/traverse trees of HTML content. I'm trying to host WebKit as a web browser control in a desktop application, and would prefer a direct API rather than going through COM. Thanks! Thanks! ...

Set Value of a TextArea inside a WebBrowser Control (C# / .NET)

I'm looking to set the value of a TextArea using the .NET WebBrowser Control. I have been able to set the values of textboxes using the following code (replace "username" with the name of the texbox): webBrowser1.Document.All.GetElementsByName("username")[0].SetAttribute("Value", "SomeUser"); I tried using similar code on a TextArea ...

getting IHTMLStyle3 from the Dom of HtmlElement in IE

I've got a System.Windows.Form.WebBrowser control on a form. I navigate that browser object to a url. Once the page has finished loading, I'd like to analyse various aspects of the page that loaded. In particular I'm interested to see the attribute 'writingMode' which is found on the IHTMLStyle3 interface. Something like: public voi...

WinForms WebBrowser Control: Force all links to open externally in a new (IE) window

I think the title covers it all. I use the control to display some basic HTML with some markups and there are maybe also links in there. What I want to do, is to force clicking on any link to get this link opened in a new IE window instead of navigating to that page in the control itself. Any idea? ...

How do I enable scripts when setting document using WebBrowser.DocumentText

I'm using the Windows Forms WebBrowser control, and getting it to display a document that I create on the fly and set using the DocumentText property. The document that I create references a script file in the same directory as my executable. Trouble is, when the WebBrowser control displays the page, the scripts aren't enabled. Now I kn...

Code works in the IDE crashes in the exe with error 91 "object variable not set"

This code works great in the IDE but crashes every time on the last line when made into an exe and run on the same machine. Any idea why? PageFinished = False Cancelling = False OKToUnload = False WebBrowser.Navigate ("https://www.example.com/index.jsp") Do While PageFinished = False 'set to true in document complete event DoEven...

Building HtmlElement object trees

I'm using the MSIE WebBrowser control in a C# desktop application and am looking for a way to build and maintain trees of HtmlElement objects outside of this control. I am trying to quickly switch between multiple complex pages without incurring the overhead of re-parsing the HTML each time (and I don't want to maintain multiple control...

How to embed flash in Mono?

Is it possible to embed flash in a mono Application? Preferably would be similar to the way it can be embedded as an ActiveX control in .Net, but anything where somehow the flash commands could bubble up to the Mono application would be fine. I had assumed that it would be possible to use the web browser to see flash, however I canno...