# Visual Basic > Visual Basic 6 and Earlier >  Another bug in the IDE

## Elroy

Hmm, I just found another bug in the VB6 IDE.

If you create a multiline TextBox, and then, from the Properties Window, try to paste in text (in the Text property) that's something over 6200 characters, it brings down the IDE.

If it's less than 5000 characters, it's all fine.

I didn't do the work to figure out exactly where the threshold was.  It's just sad that it crashes the IDE.

----------


## jdc2000

I wonder what happens if you paste in 4999 characters, and then try to add mode characters, either by more pasting or by typing.

----------


## Elroy

> I wonder what happens if you paste in 4999 characters, and then try to add mode characters, either by more pasting or by typing.


IDK, I didn't try it.  I'm now just changing things to use the project's resources rather than a textbox.  I was just using it for some text that's pasted into the clipboard and handed to the user (from a hidden textbox).

----------


## Zann

> If you create a multiline TextBox, and then, from the Properties Window, try to paste in text (in the Text property) that's something over 6200 characters, it brings down the IDE.


I just tried this and it seems I can paste a maximum of 28000 characters. There is no crash and there is no error.

----------


## daveyk021

> Hmm, I just found another bug in the VB6 IDE.
> 
> If you create a multiline TextBox, and then, from the Properties Window, try to paste in text (in the Text property) that's something over 6200 characters, it brings down the IDE.
> 
> If it's less than 5000 characters, it's all fine.
> 
> I didn't do the work to figure out exactly where the threshold was.  It's just sad that it crashes the IDE.


I've been able to keep up to at least 32,000 characters in a text box.  Here's code I use:



```
Public Sub TextAdd(Optional Text As String)
    Dim n As Integer, L As Double, X As Integer
    Dim Text2 As String
    '
    L = Len(Text)
    If L > 32000 Then Text = Left(Text, 32000)
    If Len(MyMain.txtMess.Text) + L > 32000 Then
        MyMain.txtMess.Text = Right(MyMain.txtMess.Text, 32000 - L - 1)
    End If
    GoSub Stripp
    
    MyMain.txtMess.Text = MyMain.txtMess.Text + Text2 + vbCrLf
   
    n = Len(MyMain.txtMess.Text)
    MyMain.txtMess.SelStart = n - 1
    MyMain.txtMess.SelLength = 1
    MyMain.txtMess.Refresh
    
Exit Sub
    
Stripp:
For X = 1 To Len(Text)
    If Mid(Text, X, 1) <> Chr(27) Then
        Text2 = Text2 + Mid(Text, X, 1)
    End If
Next X
Return
End Sub
```

----------


## Elroy

> I've been able to keep up to at least 32,000 characters in a text box. Here's code I use:


Ohh, using the API, I can get up to 2GB into the textbox.  I was specifically talking about pasting text into the "Text" property of a multiline TextBox via the *Properties Window* while in design mode.  That's where I'm getting a new error.  In the past, I haven't really used that feature very strongly, but I've got a large blob of text I want to hand to the user when they ask for it, and a TextBox seemed a natural way to do it.  I just changed it to put it into the resources as a custom resource.

----------

