FIX: Masked Edit Control Replaces Input if PromptChar Changed
Article ID: 150188
Article Last Modified on 7/16/2004
APPLIES TO
- Microsoft Visual Basic 4.0 Standard Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 16-bit Enterprise Edition
- Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
This article was previously published under Q150188
SYMPTOMS
Any input characters inside the Masked Edit control when the PromptChar
character is changed are converted to the new PromptChar in the 32-bit
edition of Visual Basic, and are deleted in the 16-bit edition.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
WORKAROUND
Store the text inside the Masked Edit control before changing the
PromptChar and restoring the saved text to the control after it has
changed.
Rather than change the PromptChar, call the following subroutine to modify
it:
Public Sub ChangePromptChar(ByVal cNewChar As String)
Dim strClip As String
strClip = MaskEdBox1.ClipText
MaskEdBox1.PromptChar = cNewChar
MaskEdBox1.SelStart = 0
MaskEdBox1.SelText = strClip
End Sub
Additional query words: kbVBp400bug kbVBp600fix kbdss kbDSupport kbVBp kbControl
Keywords: kbbug kbfix KB150188