Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

textbox.appendtext does not seem to follow MaxLength

15 views
Skip to first unread message

Ryan

unread,
Jul 16, 2003, 12:43:44 PM7/16/03
to
I am having a problem when using the appendtext prodecure within a textbox.
Basically, I set MaxLength on the textbox to 0 so it should only be limited
by the memory on the machine. For some strange reason, using this method
only allows me to jam a little over 32000 characters in the text box and no
more. This worked in VS.NET 2002 but seemed to break in VS.NET 2003.

Can someone try this code and let me know if you have the same issues?

1) Set up a new project
2) Put in a textbox
3) Set MultiLine = True and MaxLength to 0

On the form load:

Dim Text as String = "0123456789" & vbcrlf
Dim i as int64

for i = 0 to 5000
me.textbox1.appendtext (Text)
next

(I think this code *should* work. It basically will keep filling up the
text box past the 32000 character hard limit that I am seeing. After this,
select the text, put it into MS Word and do a character count... There
should be about 50000 (10 Characters * 5000) I am not sure if vbCRLF counts
but it does not really make a difference in this case)

I think it is a bug in VS.NET 2003.


Scot Rose [MSFT]

unread,
Jul 16, 2003, 2:51:25 PM7/16/03
to
The problem appears to be in the AppendText portion... THIS works

Dim Text As String = "0123456789"
Dim i As Int64
Dim Mystr As String

For i = 0 To 5000
Mystr = Mystr + Text

Next
Me.TextBox1.Text = Mystr
MsgBox(TextBox1.Text.Length)

What you sent did as you described.. I found out there is a bug on this and it is supposed to have been resolved , At this stage however WHEN is not something I know. Another
workaround is this.

Dim Text As String = "0123456789" & vbCrLf
Dim i As Int64
Dim MyStr As String
For i = 0 To 5000
MyStr = MyStr + Text
Me.TextBox1.Text = MyStr
TextBox1.Refresh()
Next

Basically the same as above but the textbox isn't empty the whole time..

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : sc...@online.microsoft.com <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.


--------------------
>From: "Ryan" <ry...@rim.net>
>Subject: textbox.appendtext does not seem to follow MaxLength
>Date: Wed, 16 Jul 2003 12:43:44 -0400
>Lines: 30
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Organization: Ye 'Ol Disorganized NNTPCache groupie
>Message-ID: <10583723...@nws01ykf.rim.net>
>Cache-Post-Path: nws01ykf.rim.net!unk...@10.101.40.10
>X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
>Newsgroups: microsoft.public.dotnet.framework.windowsforms.controls
>NNTP-Posting-Host: c109.rim.net 206.51.26.109
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.windowsforms.controls:9542
>X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms.controls

Claes Bergefall

unread,
Jul 17, 2003, 3:57:35 AM7/17/03
to
This is a new feature/bug in 2003. The framework code for AppendText
temporarily set the max length to 32767 before appending the text. After
that
it resets it to whatever it was before.

See the following post for an another implementation of it (NOTE: long
link):
http://groups.google.com/groups?hl=sv&lr=&ie=UTF-8&oe=UTF-8&selm=uusMq9GQDHA.560%40TK2MSFTNGP10.phx.gbl


/claes


"Ryan" <ry...@rim.net> wrote in message
news:10583723...@nws01ykf.rim.net...

0 new messages