Hello all.
I'm creating a C# CMS for our website, and I'm trying to incorporate a WYSWIG HTML editor for a couple of screens.
I'm running into a difficulty with styles though.
In the DocumentCompleted event I am adding styles like this:
As long as I don't set designMode to "On", the styles work and what is loaded appears with the styles I specified. Once I set designMode to "On", the styles are lost.
I found some documentation that seems to indicate that setting designMode to "On" reloads the contents - I figured this might be clearing the styles I set. So I set designMode to "On" before creating the styles, and as soon as it tries to create the stylesheet I get an error: "Error HRESULT E_FAIL has been returned from a call to a COM component."
Anyone have any clues on how to handle this?
Thanks.
I'm creating a C# CMS for our website, and I'm trying to incorporate a WYSWIG HTML editor for a couple of screens.
I'm running into a difficulty with styles though.
In the DocumentCompleted event I am adding styles like this:
Code:
IHTMLStyleSheet sheet = doc.createStyleSheet("", 0);
sheet.addRule("body", "font-family: Calibri, Tahoma, Verdana, Helvetica, Arial;", -1);
...
As long as I don't set designMode to "On", the styles work and what is loaded appears with the styles I specified. Once I set designMode to "On", the styles are lost.
I found some documentation that seems to indicate that setting designMode to "On" reloads the contents - I figured this might be clearing the styles I set. So I set designMode to "On" before creating the styles, and as soon as it tries to create the stylesheet I get an error: "Error HRESULT E_FAIL has been returned from a call to a COM component."
Anyone have any clues on how to handle this?
Thanks.