为.NET程序中的系统对话框启用XP外观
.NET程序中的有些对话框实际上是对Win32对话框的封装,比如MessageBox.在默认情况下,新建立的.NET程序中使用MessageBox.Show()打开MessageBox时,此对话框的样式为Windows2000风格:
若要启用XP/Visat/Win7系统的新风格,可以为程序添加一个manifest配置文件:
1.在.net项目中添加一个app.manifest配置文件:
2.打开所添加的app.manifest文件,找到系统控件风格配置代码:
1: <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
2: <!--<dependency>
3: <dependentAssembly>4: <assemblyIdentity5: type="win32"6: name="Microsoft.Windows.Common-Controls"7: version="6.0.0.0"8: processorArchitecture="*"9: publicKeyToken="6595b64144ccf1df"10: language="*"11: />12: </dependentAssembly>13: </dependency>-->