| 
| 
FIX: Extra Chars in Masked Edit Cause Empty InvalidText Box
ID: Q95508
 
 |  The information in this article applies to:
 
 
Microsoft Visual Basic Professional Edition for Windows, version  2.0
 
 
 SYMPTOMS
Entering more characters than specified in the Mask property of a Masked
Edit control generates a ValidationError event, and the InvalidText
parameter is set to the empty string.
 The InvalidText parameter should be set to the value of the Text property
for the masked edit control, including the invalid character.
 
 STATUS
Microsoft has confirmed this to be a bug in the Professional Edition
of Microsoft Visual Basic version 2.0 for Windows. This problem was
partially corrected in Microsoft Visual Basic version 3.0 for Windows.
In version 3.0, the InValidText returned has only as many characters as
allowed by the Mask. For example, if the Mask is "##" and you type "123"
the InvalidText returned is "12"
 
 MORE INFORMATIONSteps to Reproduce ProblemAt this point, you'll see an empty message box. Instead of being empty,
the message box should display "12" -- the masked portion of the "123"
entered in step 6.Start Visual Basic or from the File menu, choose New Project (ALT, F, N)
   if Visual Basic is already running. Form1 is created by default.
 
 From the File menu, choose Add File. In the Files box, select the
   MSMASKED.VBX custom control file. The Masked Edit tool appears in the
   Toolbox. In Visual Basic version 3.0, MSMASKED.VBX is automatically
   installed.
 
 Add a masked edit control (MaskedEdit1) to Form1 and change its Mask
   property to ##.
 
 Add the following code to MaskedEdit1_ValidationError:
   Sub MaskedEdit1_ValidationError (InvalidText As String,
      StartPosition As Integer) 'This must be on a single line.
      MsgBox InvalidText
   End Sub 
 
 From the Run menu, choose Start (ALT, R, S) to run the program.
 
 Type 123 into the masked edit control.
 
 Additional query words: 
buglist2.00 fixlist3.00 2.00 3.00 blank  
Keywords          : Version           :
 Platform          :
 Issue type        :
 |