PRB: Long String Assigned to Multiline Text Box Seems to Hang (76635)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic Standard Edition for Windows 1.0

This article was previously published under Q76635

SUMMARY

On some computers, when you assign a long text string to a multiline text box, it takes a long time (1 to 2 minutes) to update. This may give the impression that Visual Basic is hung, when in fact it is not.

MORE INFORMATION

Windows has a problem inserting line breaks in multiline text boxes. The amount of time needed to complete the process grows exponentially as the length of the string increases.

Steps to Reproduce Problem

  1. In Visual Basic, place a text box (Text1) on a new form, and change the MultiLine property of Text1 to True.
  2. Place the following statement in the Form_Click event procedure:
       text1.text=string$(32767,"X")
    						
  3. From the Run menu, choose Start.
  4. Click the form.
The application may now take up to two minutes to respond to any other events because it is still executing the text1.text assignment.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbprb KB76635