32K limit in TextBox ?!

  • Thread starter Thread starter Paul E Collins
  • Start date Start date
P

Paul E Collins

I'm writing an application with a TextBox control on its main form.
I'm running the application under WinXP Pro, so (as I understand it)
there should be no practical limit to the number of characters in a
text box.

However, when I paste in a large amount of text, the text box
truncates it at exactly 32K characters. This is a problem, because I
need to know exactly how many of each character were pasted; besides,
I wasn't expecting the text box to "fill up" under normal
circumstances.

Why would my text box truncate text at 32K, when I'm absolutely sure I
was able to paste much more than 32K of text in the same application
before?

P.
 
Hi,

I do remember this was discussed a couple of months ago. Take a look at the
archives.

Cheers,
 
Paul E Collins said:
[pasted text is truncated at 32K chars in TextBox]

Okay - I found the "problem". My paste code was setting SelectedText.
It seems that SelectedText truncates any string at 32K characters,
even though there's nothing about this in the documentation.

I'm now setting Text instead, and it works correctly.

P.
 
Back
Top