PRB: Long String Assigned to Multiline Text Box Seems to Hang

Last reviewed: June 21, 1995
Article ID: Q76635
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0

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.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbprg kbprb
KBSubcategory: PrgCtrlsStd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.