简体   繁体   中英

Adjust WinForms app title bar to user theme

I'm creating a WinForms app in Visual Studio 2019 (targeting .NET Framework 4.7.2). The app will be primarily for Windows 10 users.
I would like to have my app change its appearance to the user's PC personalization settings (Settings > Personalization > Colors > 'Choose your color'). I've found a way to determine the user's theme color here .

However, I haven't found a way to change my app's title bar's color. A lot of Googling constantly brings me to outdated solutions for Windows 7. I am currently using the dark theme and my app's title bar is still white. Is this impossible in Windows Forms?

I'm creating a WinForms app in Visual Studio 2019 (targeting .NET Framework 4.7.2). The app will be primarily for Windows 10 users.
I would like to have my app change its appearance to the user's PC personalization settings (Settings > Personalization > Colors > 'Choose your color'). I've found a way to determine the user's theme color here .

However, I haven't found a way to change my app's title bar's color. A lot of Googling constantly brings me to outdated solutions for Windows 7. I am currently using the dark theme and my app's title bar is still white. Is this impossible in Windows Forms?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM