UAE Entering Text into MultiLine Text Box in VB for Windows

ID Number: Q80669

1.00

WINDOWS

buglist1.00

Summary:

Entering text into a Visual Basic text box can give an "Unrecoverable

Application Error" (UAE) when the MultiLine property is True (-1) and

all of the following events coincide:

- The text box contains text that has word-wrapped to the next line.

- You increase the text box width so that the wrapped text fits on

one line.

- You immediately type a character into the text box before any

other action. Windows terminates the application with a UAE.

Microsoft has confirmed this to be a problem in Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

If you move the cursor before typing a character into the text box,

the problem does not occur.

Workaround

----------

To work around the problem, set the SelStart property when you change

the width of the text box. For example:

Sub Form_Resize ()

Text1.Width = Form1.Width ' resize Text1

Text1.SelStart = Text1.SelStart ' work around UAE

End Sub

Steps to Reproduce Problem

--------------------------

1. Run Visual Basic or, if Visual Basic is already running, select the

File menu, New Project (ALT, F, N). Form1 will be created by

default.

2. Place a text box named Text1 on Form1.

3. Set the height of Text1 so that more than one line of text will

fit.

4. Set the MultiLine property of Text1 to True (-1).

5. Move Text1 to the upper left corner of Form1.

6. Enter the following code.

Sub Form_Resize ()

Text1.Width = Form1.Width

End Sub

7. Press F5 to run the program.

8. Resize Form1 so that it is as narrow as possible. This makes it

easier to enter text in Text1 that wraps.

9. Type "one two three" so that some text wraps to the next line.

10. Maximize Form1 by clicking on the maximize button.

11. Press a key to insert text into Text1, such as SPACEBAR. The

message "Unrecoverable Application Error" appears.

Additional reference words: 1.00