2009-06-05 30 views
4

我们正在设计一个winforms应用程序,为了使其外观与系统主题相匹配,我们试图将自己限制在SystemColors类中的颜色。但是,如果不知道在不同主题中对应哪种颜色,有时很难选择合适的颜色。我可以在Visual Studio中看到当前主题的调色板,但是在那里我可以同时看到所有调色板?理想情况下,我想要一张表格,显示每种经典XP(蓝色,橄榄,银色,皇家)和Vista的颜色。我在何处或如何看到不同主题中的各种SystemColors?

回答

0

我不知道如何设置调色板,但如果这能帮助,您可以测试它的配色方案通过System.Windows.Forms.VisualStyles活跃:

if(VisualStyleInformation.ColorScheme == "NormalColor") 
{ 
    // blue color scheme 
} 
else if(VisualStyleInformation.ColorScheme == "HomeStead") 
{ 
    //olive green 
} 
else if (VisualStyleInformation.ColorScheme == "Metallic") 
{ 
    //silver 
} 
相关问题