This is the discussion forum for the HtmlEditor. See also the
HtmlEditor home page, where you can download the control, and the
Documentation Wiki, a collaborative project for documenting the control.
m_htmldoc.body doesnot refresh with LoadDocument()
Posted by:
Atara Halamish (---.bb.netvision.net.il)
Date: Thursday, 30-Oct-2003, 14:38:11
I would like to use this control because it is much better than using microsoft mshtml.
In my application I dynamically change the doc, using -
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<html><head>");
sb.Append("<STYLE TYPE='text/css'> ... </STYLE>");
sb.Append("</head>");
sb.Append("<BODY id='imcBODY' scrolls='no' border='0px' >");
sb.Append("<TABLE id='imcTable' cellspacing='0' cellpadding='2' cols='1' width='100%' border='0'>");
...
sb.Append("</body></html>");
this.LoadDocument(sb.ToString());
and it is works fine.
My Problem: I need to know the bottom of the document.
with mshtml I could use -
mshtml.HTMLDocument doc = this.m_htmldoc;
mshtml.HTMLBodyClass docBody = (mshtml.HTMLBodyClass)(doc.body);
int bodyScrollHeight = docBody.scrollHeight;
but when using HTMlEditor <Body> allways contains only <p></p>
even though I can see the all HTML I have loaded in the control.
what do I need to add in order that this.m_htmldoc.body will update?
Thanks.
Re: m_htmldoc.body doesnot refresh with LoadDocument()
Posted by:
Tim (142.131.246.---)
Date: Sunday, 02-Nov-2003, 16:04:31
For testing, you can use DoEvents:
- call LoadDocument
while (htmlEditor1.ReadyState != "complete")
{
Application.DoEvents();
}
- now work with the new document
A more robust solution is to handle the control's ReadyStateChanged event. The ReadyState is a property of the event args.
Tim