为.NET程序中的系统对话框启用XP外观
2010-06-02 13:01
260 查看
.NET程序中的有些对话框实际上是对Win32对话框的封装,比如MessageBox.在默认情况下,新建立的.NET程序中使用MessageBox.Show()打开MessageBox时,此对话框的样式为Windows2000风格:
若要启用XP/Visat/Win7系统的新风格,可以为程序添加一个manifest配置文件:
若要启用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: <assemblyIdentity
5: 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>-->
3.去掉dependentAssembly节点的注释标记,然后重新编译程序,即可启用新的系统控件外观风格:
相关文章推荐
- 在MFC程序中启用XP新控件外观
- .net 4.0下发布程序,xp系统提示sqlite.dll需要依赖库问题
- Qt系统对话框中文化及应用程序实现重启及使用QSS样式表文件及使用程序启动界面
- Vs2010 开发的基于.net 2.0的程序不能在xp下运行
- 如何使得.Net程序具有XP控件的样式风格
- 运行程序:xp系统中在运行(cmd)中运行程序
- [转]C#程序无法在64位系统上运行之.NET编译的目标平台
- 代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
- Xp系统下查看计算机所有程序的方法
- .Net程序随系统开机启动(仿Foxmail托盘效果控制)
- .net 用C# 开发系统托盘程序
- 呃,如何使 .NET 程序,在 64位 系统 中,以 32位 模式运行。
- VS2005编译的程序在XP系统下不能运行的解决办法
- VS2008中对.Net 3.5 sp1程序打安装包的前提系统环境的配置
- 我的XP日文系统,现在Installer安装程序变成乱码,解决方案。
- 让咱们的.Net程序在64位系统上跑起来
- VC++中启用XP主题外观
- MSSql中启用xp_cmdshell调用第三方程序以及遇到中文路径时报错的解决方案
- 【杂谈】在XP下安装SQL 2005开发版时出现:SQL Server 安装程序无法获取 ASPNET 帐户的系统帐户信息
- .NET插件系统(三) 插件间通信问题——设计可自组织和注入的组装程序