BUG: BackColor of MaskEdBox Control Changes When Enabled=False

Last reviewed: September 26, 1997
Article ID: Q174321
The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise

Editions for Windows, version 5.0 on the following platform: Win95

SYMPTOMS

When you set the Enabled property of the Masked EditBox control to False, the Backcolor of the control changes and cannot be changed to another color.

CAUSE

When you set the Enabled property of the Masked EditBox control to False, the Backcolor of the control changes to the Windows Control Panel setting for "3D Objects." This problem occurs under the following circumstances:

  • You are using Visual Basic version 4.0.

    - or -

  • You are using Visual Basic version 5.0 on Windows 95.

RESOLUTION

To work around this problem, place the Masked Edit control inside a PictureBox control. Then, to disable the Masked Edit control, set the Enabled property of the PictureBox to False.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Start a new project.

  2. Add a reference to the "Microsoft Masked Edit Control" (MSMASK32.OCX).

  3. Add a MaskEdBox, TextBox and CommandButton to Form1.

  4. Add the following code to the Click event of Command1:

          Text1.Enabled = False
          MaskEdBox1.Enabled = False
    

  5. Press the F5 key to run the project. Click Command1.

    Results: The BackColor of the MaskEdBox changes to the "3D Objects" color setting while the BackColor of the TextBox remains unchanged.


Additional query words: masked edit box editbox msmask32.ocx
Keywords : vb5all VBKBAX VBKBComp VBKBCtrl
Version : WINDOWS:5.0
Platform : Win95 WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.