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
KI-Zusammenfassung: 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.
Quellcode
<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"> 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>
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"><System.STAThread()> _<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>
System.Windows.Forms.Application.EnableVisualStyles()<br>
System.Windows.Forms.Application.Run(</font><font SIZE="2" COLOR="#0000ff">New</font><font SIZE="2">
frmDecode) <font color="#009900"> ' 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>
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()); </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> // 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>
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> </p>
<div style="border-bottom-style: solid; border-bottom-width: 1">
<p align="left">Enjoy!!! & 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>
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine