<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
  <channel>
    <title>HtmlEditor</title>
    <link>http://www.itwriting.com/phorum/list.php?3</link>
    <description><![CDATA[For discussion of the .Net HTMLEditor control]]></description>
    <language>EN</language>
    <pubDate>Thu, 08 May 2008 22:33:52 +0100</pubDate>
    <lastBuildDate>Thu, 08 May 2008 22:33:52 +0100</lastBuildDate>
    <category>HtmlEditor</category>
    <generator>Phorum 5.1.25</generator>
    <ttl>60</ttl>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,4098#msg-4098</link>
      <author>Mijail Paz</author>
      <description><![CDATA[Its more easy if you use mshtml.HTMLWindow2<br />
<br />
something like this<br />
<br />
mshtml.HTMLDocument doc;<br />
doc = mi_htmlEditor.Document<br />
doc.parentWindow.scrollTo(0, 9999);<br />
<br />
that it :P]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,4098#msg-4098</guid>
      <pubDate>Thu, 08 May 2008 22:33:52 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1645#msg-1645</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[In testing I found that the text wraps appropriately when there are spaces. I was testing with a long single string of characters and was expecting it to wrap just like a text box. If I use sentences it works fine. I would still be interested in figuring out how to get it to wrap single strings as well when they exceed the margin limits. Not sure how to do that or if it can be done. I was hoping that there was some API that we could call to say &quot;EM_NEXTLINE&quot; and it would skip to the next line. I could do it manually with &lt;BR&gt;'s but don't want to interfere with the underlying HTML code.<br />
<br />
Thanks.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1645#msg-1645</guid>
      <pubDate>Thu, 04 Nov 2004 17:17:52 +0000</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1644#msg-1644</link>
      <author>cliffhanger</author>
      <description><![CDATA[Sorry for the delay - I've been quite busy for the last week.<br />
<br />
You are right in assuming that setting the HTMLBody's noWrap member to false will cause your text and images to wrap before a scrollbar appears.  I put that single line of code in a wrapper I wrote for the htmlEditor that makes it act a little like a RichTextBox.  I wasn't modifying the code of the editor itself.<br />
<br />
Note, you might get an error on<br />
<br />
((HTMLBody)htmlEditor.Document.body).noWrap = false;<br />
<br />
if you try to execute it before the htmlEditor's readyState is &quot;complete&quot;]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1644#msg-1644</guid>
      <pubDate>Thu, 04 Nov 2004 16:17:12 +0000</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1639#msg-1639</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[Cliffhanger, can you please post the code for this?]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1639#msg-1639</guid>
      <pubDate>Wed, 03 Nov 2004 13:18:26 +0000</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1633#msg-1633</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[I still haven't been able to figure this one out. If anyone can lead me in the right direction about how to do this please let me know. Code will be needed so please post it.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1633#msg-1633</guid>
      <pubDate>Fri, 29 Oct 2004 20:12:46 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1629#msg-1629</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[I got my dunce hat on today. I hate to say it but I think I will need to see the code on this one. I think I understand how to do this but I don't know exactly where to place it in my code.<br />
<br />
Here are my expectations. Once I set the noWrap = false then my text and images will automagically go to the next line before the horizontal scrollbar appears. Are my expectations correct?<br />
<br />
Please post this code and let me know where you put it ( in the htmlsite\editor.cs or main form etc).]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1629#msg-1629</guid>
      <pubDate>Sun, 24 Oct 2004 20:17:31 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1623#msg-1623</link>
      <author>cliffhanger</author>
      <description><![CDATA[Modification to my previous post:<br />
<br />
When you use the vertical scrollbar from the panel control, you can't manually scroll the htmlEditor's content because the panel realizes that the htmlEditor control itself does not extend outside the panel.<br />
<br />
I used a vertical scrollbar instead.  If anyone's interested, I'll post the code.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1623#msg-1623</guid>
      <pubDate>Sun, 24 Oct 2004 13:54:42 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1622#msg-1622</link>
      <author>cliffhanger</author>
      <description><![CDATA[Michael,<br />
<br />
Thanks, I forgot to mention that above.  You just have to cast the body member as the class not the interface:<br />
<br />
((HTMLBody)htmlEditor.Document.body).noWrap = false;<br />
<br />
That line is all you need to have vertical scrolling only.  What I was trying to do was to have horizontal scrolling only to a point --- like Microsoft Word's Page Layout view when the window is smaller than the page width.<br />
<br />
Good luck!]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1622#msg-1622</guid>
      <pubDate>Sun, 24 Oct 2004 13:49:11 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1621#msg-1621</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[Thanks CliffHanger for the info. I see that you mentioned a &quot;htmlEditor.Document.body.noWrap = false&quot; statement. I guess the initial code doesn't have this because I can't find it. Is there a location for checking out the code you have done thus far? Particularly what is behind the noWrap method.<br />
<br />
I think we are on the same page. I basically want to emulate the style of an HTML email composition in Outlook. There you have only the vertical scrollbar and not the horizontal. Is this what you have been able to achieve? <br />
<br />
Thanks again.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1621#msg-1621</guid>
      <pubDate>Sun, 24 Oct 2004 03:43:59 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1619#msg-1619</link>
      <author>cliffhanger</author>
      <description><![CDATA[]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1619#msg-1619</guid>
      <pubDate>Sat, 23 Oct 2004 20:07:12 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1613#msg-1613</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[By this point I guess I am the only guy persuing this topic but thought I better keep it open just in case.<br />
<br />
I found out how to get the caret position and determined that if it's x coordinate is 33 pts less than the width of the control (meaning that the htmleditor is width of 1024, and the caret is at x 991) we need to move to the next line otherwise the horizontal scrollbar will appear. <br />
<br />
The ugly way to do this is to insert a &lt;BR&gt; before the character, or word, and insert the charater or word on the next line. This seems to work well but if the page is resized for some reason the scrollbar would show up again. <br />
<br />
The goal is to produce some sort of solution like MS Outlook, where the text and images are more AutoWrapped than they are done with &lt;BR&gt;'s.<br />
<br />
Does anyone know how TextAreas and other html components wrap text automatically? I am guessing I could use the same thing here if I knew where to start looking. <br />
<br />
Thanks.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1613#msg-1613</guid>
      <pubDate>Thu, 21 Oct 2004 22:50:53 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1599#msg-1599</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[I had a couple of thoughts on how this might be accomplished but not sure how to implement it. This wouldn't be exact but might be close enough.<br />
<br />
Probably on the OnValueChange event of HTMLEditor, assuming that there is one, you could possibly create a IHTMLTxtRange of the entire line and based on the number of characters fudge the width and if it is greater than your htmleditor.size.width - 8 (replace 8 with what ever looks like your margin) insert a &lt;BR&gt; or some HTML code to represent a break in the line. <br />
<br />
The problem here is knowing how to get the number of characters in the line. I don't know how to programatically get a line of information. You can select words, characters and sentences but not lines. <br />
<br />
It also could possibly be done based on the caret position. If it's x or y coordinates is close to the location of the htmleditor screen then act on it.<br />
<br />
Once again this involves using the IHTMLCaret but not sure how to do that.<br />
<br />
Thoughts?]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1599#msg-1599</guid>
      <pubDate>Thu, 21 Oct 2004 15:26:42 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1592#msg-1592</link>
      <author>Michael Yarbrough</author>
      <description><![CDATA[I too am working on finding a way to get the text to wrap before the horizontal scrollbar is displayed. Any ideas on this? I could insert a &lt;BR&gt; or something in the HTML if I could figure out how to capture the &quot;horizontalscrollbar about to show&quot; event. <br />
<br />
Thanks again for this awesome tool. I have been working for a few weeks on an HTML Editor with the DHTML editor for IE 5. I got most of the bugs out but it doesn't work nearly as well as this one. Once I get this wrapping thing done I will be set.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1592#msg-1592</guid>
      <pubDate>Wed, 20 Oct 2004 00:03:27 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1541#msg-1541</link>
      <author>cliffhanger</author>
      <description><![CDATA[Thanks for the suggestion, Joerg, but I haven't had success with it yet.<br />
I'm simultaneously exploring two options.<br />
<br />
First, I tried your suggestion of applying styles to the BODY to limit the width of the page.  I put the following the code in the document.  The font was changed, but the document was still word-wrapped at the dimensions of the control and not at 8 inches:<br />
<br />
&lt;html&gt;<br />
&lt;style type=\&quot;text/css\&quot;&gt;<br />
BODY { font-family: arial; font-size: 10pt; width: 8in; }<br />
&lt;/style&gt;<br />
&lt;body&gt;<br />
...<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
Second, I'm still curious whether it is possible to make the htmlEditor a sort of &quot;document&quot; (you can disable its scrollbars) and place it in a panel control that functions as a sort of &quot;view&quot; on that document.  I am certain that I can make this work if there is a way for the htmlEditor control to expand along with the content that is loaded or typed into it.  How would that work?  (I am an amateur when it comes to COM)<br />
<br />
]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1541#msg-1541</guid>
      <pubDate>Sun, 12 Sep 2004 22:57:57 +0100</pubDate>
    </item>
    <item>
      <title>Re: custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1538#msg-1538</link>
      <author>Joerg Krause</author>
      <description><![CDATA[Limiting the width (or height) of a document cannot be done by the control itself, because you're editing not exactly on the surface but on the underlying HTML document. To limit the user from exceeding 8in I suppose using CSS and build a container for the content, either using a DIV or the BODY tag.<br />
<br />
If the container exceeds the limits of the control the control will produce scrollbars (and not the panel container) and the user can scroll to the invisible regions.<br />
<br />
Even though you limit the container in the way you described (if it would work) the document will behave in the way I told you and you'll probably get two scrollbars, which is obviously not the expected result.<br />
<br />
-Joerg<br />
(Commercial and feature reach alternativ HTML Editor Control, see www.comzept.de)<br />
<br />
]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1538#msg-1538</guid>
      <pubDate>Sun, 12 Sep 2004 10:39:41 +0100</pubDate>
    </item>
    <item>
      <title>custom scrolling / page width</title>
      <link>http://www.itwriting.com/phorum/read.php?3,1537,1537#msg-1537</link>
      <author>cliffhanger</author>
      <description><![CDATA[Thanks to everyone involved in this project - this control has solved several problems for me.<br />
<br />
I would like to have a document 8in wide and infinitely tall displayed in a view that, naturally, is smaller.  I am trying to get the text to wrap at 8in.  I tried adjusting the dimensions of the rectangle sent to view.SetRect in the Container_Resize event handler and placing the htmlEditor control inside a panel control.  The panel's AutoScroll property can be set to True, and I can hide the editor's scroll bar by replacing DOCHOSTUIFLAG.FLAT_SCROLLBAR with DOCHOSTUIFLAG.SCROLL_NO, but now I'm stuck.  Is there a way to let the document expand and can I be notified when it does?  Is there a simpler way of doing this?  Thanks in advance for any suggestions.]]></description>
      <category>HtmlEditor</category>
      <guid isPermaLink="true">http://www.itwriting.com/phorum/read.php?3,1537,1537#msg-1537</guid>
      <pubDate>Sun, 12 Sep 2004 01:06:41 +0100</pubDate>
    </item>
  </channel>
</rss>
