BUG: MaskedEdit MaxLength Reset to 64 When Mask="" (99873)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q99873 SYMPTOMS
When the Mask property of the MaskedEdit custom control is set to two
quotation marks (""), the MaxLength property is incorrectly reset to
64. However, the control continues to correctly limit input based on the
original MaxLength setting, and you can change the value of MaxLength to
establish a different maximum text limit for the control.
WORKAROUND
To work around the problem, store the MaxLength property before setting
the Mask property of the MasedEdit custom control. Then reset the
MaxLength setting after setting the Mask property.
For example, replace the code shown in the Command2_Click event procedure
in step 3 of the More Information section below with this code:
Sub Command2_Click ()
Dim ml As Integer
'Store the current MaxLength property value
ml = maskededit1.MaxLength
maskededit1.Mask = ""
maskededit1.Text = ""
'Restore the MaxLength property value since
'it has incorrectly been reset to 64
maskededit1.MaxLength = ml
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
Modification Type: | Major | Last Reviewed: | 10/30/2003 |
---|
Keywords: | kbbug KB99873 |
---|
|