今天去新华书店溜达,发现了Simon Robinson写的《Advanced .NET Programming》一书,里面提到了XP风格界面的问题。
记录一下,也许对于博客园这已经不是什么新鲜事了。
其实就是一个manifest文件。
<?
xml version="1.0" encoding="UTF-8" standalone="yes"
?>
< assembly xmlns ="urn:schemas-microsoft-com:asm.v1" manifestVersion ="1.0" >
< assemblyIdentity
version ="1.0.0.0"
processorArchitecture ="X86"
name ="Microsoft.Winweb.FormTest"
type ="win32"
/>
< description > .NET control deployment tool </ description >
< dependency >
< dependentAssembly >
< assemblyIdentity
type ="win32"
name ="Microsoft.Windows.Common-Controls"
version ="6.0.0.0"
processorArchitecture ="X86"
publicKeyToken ="6595b64144ccf1df"
language ="*"
/>
</ dependentAssembly >
</ dependency >
</ assembly >
< assembly xmlns ="urn:schemas-microsoft-com:asm.v1" manifestVersion ="1.0" >
< assemblyIdentity
version ="1.0.0.0"
processorArchitecture ="X86"
name ="Microsoft.Winweb.FormTest"
type ="win32"
/>
< description > .NET control deployment tool </ description >
< dependency >
< dependentAssembly >
< assemblyIdentity
type ="win32"
name ="Microsoft.Windows.Common-Controls"
version ="6.0.0.0"
processorArchitecture ="X86"
publicKeyToken ="6595b64144ccf1df"
language ="*"
/>
</ dependentAssembly >
</ dependency >
</ assembly >
name ="Microsoft.Winweb.FormTest"
此处要填exe的名字,然后用VS打开exe文件,导入manifest文件,资源类型设置为RT_MANIFEST,ID设置为1,保存就可以了。
注意:控件的FlatStyle属性的值要设置成System。
以上是我的无废话精简版,更详细的参考请看 这里,好像这里也是从Advanced .NET Programming中抄的 。