Advertisement
2_2002-2004 Windows CE #131004

Easily add WinXP themes to your applications without manifest! Just 5 lines of code!!!

This is a very simple way of add WinXP themes to your applications! Tired of carrying arround unwanted manifest files??? well this uses only 5 lines of code ;)

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
<html>
<p align="center"><b>Howto</b>: <i><font color="#000080" face="Arial"><u>
Correctly add WinXP themes to your Applications</u></font></i></p>
<p align="justify"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; Hello again! 
This is a simple tutorial that shows what you have to do in order to have your 
application running WinXP themes the correct way. <br>
&nbsp;&nbsp;&nbsp; I've seen for a long time that people often use Manifest 
files but that is not a solution, so check this out:<br>
<br>
</font><font face="Arial" color="#800000"><u><b>VB.NET</b></u></font></p>
<div style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
 <p align="justify"><font face="Arial" size="2" color="#009900">' ADD THIS LINE 
 OF CODE INSIDE THE </font><u><i><font face="Arial" size="2" color="#009900">
 WINDOWS FORM GENERATED CODE</font><font face="Arial" size="2" color="#00CC00"><br>
 </font></i></u><font SIZE="2">&lt;System.STAThread()&gt; _<br>
 </font><font SIZE="2" COLOR="#0000ff">Public</font><font SIZE="2"> </font>
 <font SIZE="2" COLOR="#0000ff">Shared</font><font SIZE="2"> </font>
 <font SIZE="2" COLOR="#0000ff">Sub</font><font SIZE="2"> Main()<br>
&nbsp;&nbsp;&nbsp; System.Windows.Forms.Application.EnableVisualStyles()<br>
&nbsp;&nbsp;&nbsp; System.Windows.Forms.Application.Run(</font><font SIZE="2" COLOR="#0000ff">New</font><font SIZE="2"> 
 frmDecode) <font color="#009900">&nbsp;' replace frmDecode by the name of your 
 form!!!</font><br>
 </font><font SIZE="2" COLOR="#0000ff">End</font><font SIZE="2"> </font>
 <font SIZE="2" COLOR="#0000ff">Sub</font></div>
<p align="justify"><font size="2" face="Arial">And that's about everything! 
Simple isn't it!!!<br>
<br>
NOTE:<br>
&nbsp;&nbsp;&nbsp; Some controls like buttons, checkboxes, radiobuttons, etc... 
have a property called FlatStyle. In order to theme this control you must set 
this property to <i>System</i>. Example:</font></p>
<div style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
 <font SIZE="2">button1.FlatStyle=FlatStyle.System
</div>
</font>
<p><font face="Arial" color="#800000"><u><b>C#</b></u></font></p>
<div style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
 <p align="justify"><font face="Arial" size="2" color="#009900">// ADD THIS 
 LINE OF CODE INSIDE </font><u><i><font face="Arial" size="2" color="#009900">
 static void Main()</font><font face="Arial" size="2" color="#00CC00"><br>
 </font></i></u><font SIZE="2"><br>
 System.Windows.Forms.Application.EnableVisualStyles();<br>
 System.Windows.Forms.Application.Run(</font><font SIZE="2" COLOR="#0000ff">new</font><font SIZE="2"> 
 Form1());&nbsp; </font><font SIZE="2" COLOR="#008000">// replace Form1 by the 
 name of your form!!!<br>
 <br>
 // IT WILL LOOK LIKE THIS:<br>
 <br>
 </font><font size="2">[STAThread]</font><font SIZE="2" COLOR="#008000"><font SIZE="2"><br>
 </font><font SIZE="2" COLOR="#0000ff">static</font><font SIZE="2"> </font>
 <font SIZE="2" COLOR="#0000ff">void</font><font SIZE="2"> </font></font>
 <font size="2">Main() <font SIZE="2" COLOR="#008000"><br>
 </font></font><font size="2">{<font SIZE="2" COLOR="#008000"><br>
 </font></font><font size="2">
 System.Windows.Forms.Application.EnableVisualStyles();</font><font SIZE="2"><font SIZE="2" COLOR="#008000"><br>
 </font>System.Windows.Forms.Application.Run(</font><font SIZE="2" COLOR="#008000"><font SIZE="2" COLOR="#0000ff">new</font><font SIZE="2">
 </font></font><font size="2">Form1());</font><font SIZE="2" COLOR="#008000"><font SIZE="2">
 </font>&nbsp;// replace frmDecode by the name of your form!!!<font SIZE="2"><br>
 </font></font><font size="2">}</font></div>
<p align="justify"><font size="2" face="Arial">And that's about everything! 
Simple isn't it!!!<br>
<br>
NOTE:<br>
&nbsp;&nbsp;&nbsp; Some controls like buttons, checkboxes, radiobuttons, etc... 
have a property called FlatStyle. In order to theme this control you must set 
this property to <i>System</i>. Example:</font></p>
<div style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
 <font SIZE="2">button1.FlatStyle=FlatStyle.System;</div>
</font>
<p>&nbsp;</p>
<div style="border-bottom-style: solid; border-bottom-width: 1">
 <p align="left">Enjoy!!! &amp; don't forget to check the file attached that 
 contains examples for both VB.NET and C#</div>
<p align="right"><font size="1">Jorge Rodrigues @ 2003 Espinho, Portugal</html>
原始评论 (3)
从 Wayback Machine 恢复