在我們用VS編寫帶界面的程序時,初始的界面風格總是類似win2000的外觀,看着總覺得有點古老。。。在這裏,給大家介紹一種方法,可以直接修改整個軟件的外觀,擁有winXP或win7外觀風格。(當然,讓程序擁有漂亮的外觀,還是美工出馬)
一共四個步驟:
1、在程序的res目錄下,創建一個名爲windows.manifest的文件;(後綴爲.manifest)
2、打開這個文件,將下面這段內容複製到文件中,保存。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Microsoft.Windows.XXXX"
processorArchitecture="x86"
version="5.1.0.0"
type="win32"/>
<description>Windows Shell</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
3、在程序的“資源視圖”中導入資源,把文件windows.manifest添加到工程的資源中,具體步驟:插入->資源->引入->文件類型改爲“所有文件"->找到windows.manifest->彈出對話框,資源類型 填"24"->確定後,再把資源的ID改爲"IDR_MANIFEST"
4.然後在String Table中添加IDR_MANIFEST,值爲1
好了,經過上述四個步驟後,將程序重新全編譯一下,就可以看到不一樣的外觀了!O(∩_∩)O哈哈
————————————————
版權聲明:本文爲CSDN博主「Code_My_Life」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/Code_My_Life/article/details/41349421