I'm using Windows XP too (which is surprisingly left out of the remarks
section of the documentation of MaxLength). I find that using AppendText
limits to the length of a signed word (2^16 - 1 = 32767), whereas using Text
+= isn't constrained. I don't know why this is, especially since the
AppendText documentation implies that it's an equal alternative to the
other.
As for the newlines, I'm finding that using \n results in a newline after a
blank box, whereas \r\n works fine for both.
Oddly, I also found that if you do an AppendText with \n, you get the box
and a newline, but if you then do a += with \n, it removes all newlines from
the textbox, leaving all text lines separated by boxes on a single line.
I'm not sure what your goals are, but I hope this helps you get something
that works.
[quoted text, click to view] "DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:ew7ZzoT6DHA.3860@tk2msftngp13.phx.gbl...
> Still no answer to this question, but since I originally posted it, I have
> created a separate application for test and verified the operation is just
> like I state here. The code for the test is at the bottom.
>
> By default, the MaxLength for a multi-line TextBox is supposed to be
>
> 4294967295 characters in all the NT based OS's and 65535 in the 9x based
>
> OS's.
>
> I have an application where I use a multi-line textbox (or tried to use a
>
> textbox but gave up) on Windows XP. The textbox is used for displaying
>
> application log information and grows fairly rapidly. The problem is that
>
> once the contents length gets to 32767, it never gets any longer, even
>
> though I have set MaxLength to 250000.
>
> When I substitute a RichTextBox in the same application with no other
>
> changes in code other than the type, the app works fine and the
RichTextBox
>
> stores up to 250000 characters.
>
> Is this a known bug in the version 1.1 framework or is there something I
may
>
> be missing?
>
> Thanks for your input,
>
> Dale
>
> private void fillText_Click(object sender, System.EventArgs e)
>
> {
>
> for (int count = 0; count < int.Parse(textBox2.Text); count++)
>
> {
>
> textBox1.AppendText("Here is another line of text; How many will it hold?"
+
>
> (char)13 + (char)10);
>
> label1.Text = textBox1.Text.Length.ToString();
>
> }
>
> }
>
> Another interesting question is why do I have to use (char)13 + (char)10?
>
> Adding "\n" at the end of my text string leaves two square boxes at the
end
>
> of the string but doesn't start a new line. "\r\n" starts a new line but
>
> leaves two square boxes at the end of each line; only (char)13 + (char)10
>
> gives a clean new line operation.
>
>
>
>