Microsoft KB Archive/262416

= BUG: eVB: Text Property in Textbox Ignores MaxLength Value =

Article ID: 262416

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q262416



SYMPTOMS
If the TextBox control contains a string greater than the MaxLength value, the entire string is still displayed.



Step-by-Step Workaround
 Open Microsoft eMbedded Visual Basic 3.0. Create a new Windows CE for the Pocket PC project. Form1 is created by default. Add a TextBox control and a CommandButton control to the form. Set the MaxLength property of the TextBox to 3.  Add the following code: Private Sub Command1_Click Text1.Text = &quot;New Text&quot; End Sub

Private Sub Text1_Change If Len(Text1.Text) > Text1.MaxLength Then Text1.Text = Mid(Text1.Text, 1, Text1.MaxLength) End If End Sub  Run the application on the device or the emulator, and click the CommandButton.</ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> Open Microsoft eMbedded Visual Basic 3.0.</li> Create a new Windows CE for the Pocket PC project. Form1 is created by default.</li> Add a TextBox and a CommandButton to the form.</li> Set the MaxLength property of the TextBox to 3.</li>  Add the following code: Private Sub Command1_Click Text1.Text = &quot;New Text&quot; End Sub </li> Run the app on the device or the emulator, and click the CommandButton. Note that the string &quot;New Text&quot; is placed in the TextBox despite the MaxLength property setting of 3. Setting the MaxLength property should only display the number of characters specified inside the TextBox.</li></ol>

Keywords: kbbug kbpending KB262416

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.