BUG: "Visible" Property Ignored when Loading VBX Controls

Last reviewed: July 22, 1997
Article ID: Q114104
1.00 1.50 WINDOWS kbprg kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft Visual C++ for Windows, versions 1.0 and 1.5
    

SYMPTOMS

After using the App Studio resource editor to disable the visible property of a VBX that is contained in a dialog, the VBX remains visible when the dialog is displayed.

RESOLUTION

NOTE: This information is taken from the section titled "Part 2: Visual Workbench" in the README.WRI file typically found in the \MSVC\HELP directory.

Using the VBX Visible Property

The Visible property of a VBX control can only be changed at run-time; you cannot make a VBX control initially invisible from AppStudio or an .RC file. To make a control invisible, you must hide the control explicitly from your code. To make a control initially invisible in a dialog, override the OnInitDialog function in your CDialog-derived class, and call ShowWindow( SW_HIDE ) for the VBX controls that you want to hide. For example:

    BOOL CMyDialog::OnInitDialog
    {
        CDialog::OnInitDialog();

        // make the control identified by IDC_GRID1 invisible
        GetDlgItem(IDC_GRID1)->ShowWindow(SW_HIDE);

        // other dialog initializations...
    }

STATUS

Microsoft has confirmed this to be a bug in the Microsoft Foundation Classes for Windows, versions 2.0 and 2.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 1.00 1.50 2.00 2.50
KBCategory: kbprg kbbuglist
KBSubcategory: MfcVBX
Keywords : kb16bitonly
Technology : kbMfc


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.