I created a simple html editor using the IHTMLDocument2 web-browser control. My problem is, when I start typing in the web browser control, it keeps going on the same line. I have this code
HTMLEditor.DocumentText = "";
doc = HTMLEditor.Document.DomDocument as IHTMLDocument2;
doc.designMode = "On"
This gives me a browser where I can start typing inside the html window. The width of this window is 440. When I start typing something and reaches the far end of the window (say I am at px 440), I was expecting the cursor to go to the next line automatically but it keesp on going and I get a scroll-bar in the window.
How can I get it to wrap to the next line?
Thanks for suggesting to use Textarea inside this document. But If I use text areat how does the following function work?
//HTMLEditor is my webbrowser contorl
private void justifybu_Click(object sender, EventArgs e)
{
HTMLEditor.Document.ExecCommand("JustifyFull", false, null);
}
//Button2 converts rich text to html.
private void button2_Click(object sender, EventArgs e)
{
string strHTMLWriter = HTMLEditor.DocumentText;
richTextBox1.Text = strHTMLWriter;
richTextBox1.Text = HTMLEditor.Document.Body.All["post-text"].InnerHtml;
this.richTextBox1.Focus();
this.richTextBox1.SelectAll();
}