是否可以在C#中更改WinForm标题栏的颜色?
__________________________
[Form1_______________-|[]|X] <- I want to change the color of this
| |
| |
| |
|__________________________|
Run Code Online (Sandbox Code Playgroud) 我已经在我的应用程序中应用了深色样式,直到那时都很好,我的问题是为什么该样式没有应用于我的应用程序的标题栏,以及在我的应用程序中打开的其余表单,如您所见,它保持白色并且看起来很糟糕,任何建议将不胜感激。
#include "mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QTextStream>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFile f(":/qdarkstyle/style.qss");
f.open(QIODevice::ReadOnly|QIODevice::Text);
QTextStream ts(&f);
a.setStyleSheet(ts.readAll());
MainWindow w;
w.show();
return a.exec();
}
Run Code Online (Sandbox Code Playgroud)
我从这里得到了主题。 https://github.com/ColinDuquesnoy/QDarkStyleSheet