32K limit in TextBox ?!
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.csharp.

Post a new message to this list...

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.

Reply to this message...
 
    
Paul E Collins
"Paul E Collins" <Click here to reveal e-mail address> wrote:

> [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.

Reply to this message...
 
    
Zürcher See
TextBox has a limit TextBox.MaxLength

"Paul E Collins" <Click here to reveal e-mail address> schrieb im Newsbeitrag
news:chpbhd$ria$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Paul E Collins
"Zürcher See" <Click here to reveal e-mail address> wrote:

> TextBox has a limit TextBox.MaxLength

Thanks, but I've set MaxLength to zero ("no limit") and I still get
the 32K problem.

P.

Reply to this message...
 
    
Ignacio Machin \( .NET/ C# MVP \)
Hi,

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

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Paul E Collins" <Click here to reveal e-mail address> wrote in message
news:chpiej$aep$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com