2012-01-12 537 views
2

在Visual Studio 2010中,我希望它嵌入清單使用默認設置:Visual Studio 2010中:如何嵌入清單使用默認設置

enter image description here

不幸的是,嵌入清單不包括6版本的依賴公共控件庫:

<?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" name="MyApplication.app"/> 
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> 
    <security> 
     <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> 
     <requestedExecutionLevel level="asInvoker" uiAccess="false"/> 
     </requestedPrivileges> 
    </security> 
    </trustInfo> 
</assembly> 

這意味着,我的WinForms應用程序 「不使用XP的主題」:

enter image description here

如何說服Visual Studio 2010包含一個清單,該清單包含對通用控件庫版本6的依賴性?

+1

對於C#應用程序,您需要Project-> Add New Item-> Application Manifest File。也就是說,我從來沒有在WinForms應用程序中這樣做過,只是爲了讓它使用comctl32 v6。確保您的控件「FlatStyle」屬性設置爲「System」。 – 2012-01-12 15:52:49

+1

Winforms使用CreateActCtx(),因此它不需要清單條目。無法使Application.EnableVisualStyles()以其他方式工作。我想這個電話已經丟失,很難猜測。 – 2012-01-12 18:46:10

+0

@HansPassant我不知道有可能LoadLibrary'comctl32.dll',並得到版本6+,沒有清單。我認爲融合加載器的目的是始終給予commctl32.dll的調用者版本5,除非他們特別要求6.您能否詳細說明如何使用激活上下文來加載更高版本的comctl32? – 2012-01-12 22:01:20

回答

1

科迪已經解決了多年來在Visual Studio中未解決的問題,這幫助我解決了我的問題。

Hans指出,爲了獲得版本6庫,您不需要聲明Common Controls Version 6的依賴關係,這也幫助我解決了我的問題。

所以他們都應該得到信用。

相關問題