
右击工程文件
Add-New Item...-Application Manifest File(defaut name is app.manifest, you can change it)
打开新添加的app.manifest,可以把里面的内容都看一下,注意最后有如下一段注释:
<!--EnablethemesforWindowscommoncontrolsanddialogs(WindowsXPandlater)--
<!--<dependency<dependentAssembly<assemblyIdentitytype=win32name=Microsoft.Windows.Common-Controlsversion=
6.0.0.0
processorArchitecture=*
publicKeyToken=
6595b64144ccf1dflanguage=*/</dependentAssembly</dependency--只要按提示把这一段代码的注释去掉就可以了。
此时应该已经可以显示为WinForm形式,如果不行,右击工程文件,打开Property面板,依次找到
Application-Resource-Manifest,将Manifest的文件设为刚刚添加的app.manifest即可
为程序添加清单文件 app.manifest默认模板里有一句 <requestExecutionLevel level="requireAdministrator" uiAccess="false" />把它替换掉asInvoker就默认为管理员运行了
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)