tags:

views:

366

answers:

2

Is there a way to convert from System.Windows.Forms.HtmlElement to mshtml.IHTMLElemenet3?

--edit after answer accepted -- This is what the code would look like.

HtmlElement myElement = getElementByID(id);
IHTMLElement3 h3 = (IHTMLElement3) myElement.DomElement;

Thanks @korchev

A: 

Not just by casting. The object hierarchy is completely disparate. You could write an explicit cast operator overload to do it yourself, however.

Robert C. Barth
+1  A: 

Just cast the DomElement property to mshtml.IHTMLElement3

korchev