none
Property page showing through RRS feed

  • Question

  • Hi All,

      I have an application using property sheets. I have two pages in the property sheet. When I switch the page first page to second page. The first property page shows through in the second.

    when I put the line below the problem disappears

    #pragma comment(linker,"\"/manifestdependency:type='win32' \
    name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
    processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

    The property page properties have a Transparent property false.

    Earlier I did not face this problem.

    please suggest pointers on where to check.

    Looking forward to your advice and help on this.

    Regards,

    Ramesh D.

    Tuesday, August 20, 2019 1:21 PM

All replies

  • Hi,

    Thank you for posting here.

    According to your issue , are you working with an old Windows MFC application that looks dated ? In my opinion, this issue is caused by the use of an old Windows MFC application that looks dated.

    So you need to use / MANIFESTDEPENDENCY to specify the Manifest dependency. /MANIFESTDEPENDENCY lets you specify attributes that will be placed in the <dependency> section of the manifest file. This will turn your application into the system default style.

    Best Regards,

    Jeanine Zhang

    Wednesday, August 21, 2019 1:59 AM
    Moderator
  • I have created this application recently and compiling under visual studio 2017. I am using CMFCPropertypage and CMFCPropertysheet classes for my property pages and property sheet respectively. I have played around with _WIN32_IE version no but it didn't work. IN my Initinstance , InitCommoControlsEx is being called. Any other place I could be using old features I do not know.

    Regards,

    Ramesh

    Wednesday, August 21, 2019 7:55 AM
  • Hi,

    I suggest you should enable Visual Styles. For more details about how to configure your application to ensure that common controls are displayed in the user's preferred visual style, I suggest you should refer to the link: https://docs.microsoft.com/en-us/windows/win32/controls/cookbook-overview

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/a66db571-6190-4232-b5b3-c81c84bacd1a/initcommoncontrolsex-failing?forum=vclanguage

    Best Regards,

    Jeanine Zhang

    Wednesday, August 21, 2019 9:41 AM
    Moderator
  • Hi,

    I have read the links.

    It is not clear, what are the available themes or visual styles.

    Can you give an example of how to apply visual style to CPropertySheet.

    For a plain property sheet Why should the controls of one page show though another page? why the dependence on the pragma... .Earlier it was working OK without the pragma.

    Regards,

    Ramesh D.



    • Edited by rameshdk Thursday, August 22, 2019 4:20 PM
    Thursday, August 22, 2019 4:17 PM
  • Hi,

    >>Can you give an example of how to apply visual style to CPropertySheet.

    To enable your application to use visual styles, you must use ComCtl32.dll version 6 or later. Because version 6 is not redistributable, it is available only when your application is running on a version of Windows that contains it. Windows ships with both version 5 and version 6. ComCtl32.dll version 6 contains both the user controls and the common controls. By default, applications use the user controls defined in User32.dll and the common controls defined in ComCtl32.dll version 5. 

    If you want your application to use visual styles, you must add an application manifest or compiler directive that indicates that ComCtl32.dll version 6 should be used if it is available.An application manifest enables an application to specify which versions of an assembly it requires.

    If you are using Microsoft Visual C++ 2005 or later, you can add the following compiler directive to your source code instead of manually creating a manifest:

    #pragma comment(linker,"\"/manifestdependency:type='win32' \
    name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
    processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

    Best Regards,

    Jeanine Zhang


    Friday, August 23, 2019 1:28 AM
    Moderator
  • Hi,

    What are the available visual styles and how do I apply them, this is not documented in the links provided by you. However the transparency problem could not be related to visual styles.

    Regards,

    Ramesh D

    Friday, August 23, 2019 6:04 AM
  • Hi,

    >>What are the available visual styles and how do I apply them?

    A visual style is a specification that defines the appearance of the Windows common controls. Visual styles changes the appearance of common controls based on the theme chosen by the user.To use visual styles, your application must be running on an operating system that contains ComCtl32.dll version 6 or later. If you want your application to use ComCtl32.dll version 6, you must add an application manifest or compiler directive to specify that version 6 should be used if it is available. 

    InitCommonControlsEx function ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL. By default, applications use the user controls defined in User32.dll and the common controls defined in ComCtl32.dll version 5.If you want your application to use visual styles, you should use ComCtl32.dll version 6 or later.

    >>However the transparency problem could not be related to visual styles

    You said:"when I put the line below the problem disappears".Add this compiler directive just to use ComCtl32.dll version 6.

    I am sorry if I understand your question wrong. Please give a more detailed description, or a code snippet that allows me to reproduce your problem,we will provide you with better help.I create a property sheets application by visual studio 2017.I have two pages in the property sheet. When I switch the page first page to second page. Did not appear the issue you described.

    Best Regards,

    Jeanine Zhang

    Friday, August 23, 2019 7:07 AM
    Moderator
  • Hi,

    Have you got any updates? If your case has been solved, please help to mark answers. If not, just feel free to contact us.

    Your understanding and cooperation will be grateful.

    Best Regards,

    Jeanine Zhang

    Wednesday, August 28, 2019 8:41 AM
    Moderator