When i create a dialog in VS 2022 in C++ it looks 2 d in the preview but when i compile it, its 3D

CodePro 20 Reputation points
2023-08-31T08:07:38.6+00:00

When i create a dialog in VS 2022 in C++ it looks 2D in the preview but when i compile it, its 3D i will show you an example in dialog editor it looks like this, 2D buttons: (image resources below). and when i open the app, it looks 3D Like this: (image resource below). see the btns they are 3D everytime i asked anyone no one could help me even chatgpt dont know how to do it please guys help thanks for any help.

image.png imagge.png

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,888 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,637 questions
{count} votes

Accepted answer
  1. Castorix31 83,206 Reputation points
    2023-08-31T08:30:24.93+00:00

    It is not 3D, it does not use Visual Styles (C.C. v5)

    In C++/Win32, you can force C.C. v6 at beginning :

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

2 additional answers

Sort by: Most helpful
  1. RLWA32 43,381 Reputation points
    2023-08-31T08:32:28.82+00:00

    In order for your dialog to display the same way that it appears in the dialog editor (use visual styles) your code needs to use the Version 6 common controls.

    This can be accomplished by placing the following in either a header file or in your C++ source file.

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

  2. CodePro 20 Reputation points
    2023-09-04T13:18:50.12+00:00

    I am thankful for you guys you solved my problem thx so much :)

    0 comments No comments