Http://hmyhuo1983.blog.163.com/blog/static/538196192009111642057993/
Summarize winform skin IrisSkin2.dll operations by yourself
Main Form
Define Form1.Designer. cs
1. Declare private Sunisoft. IrisSkin. SkinEngine skinEngine1;
2 then the code generated in InitializeComponent ()/Windows Form Designer/
Define this. skinEngine1 = new Sunisoft. IrisSkin. SkinEngine (System. ComponentModel. Component) (this )));
3. Define the constructor In the Form. cs file:
This. skinEngine1.SkinFile = Application. StartupPath + "// DiamondBlue. ssk ";
1. first, add the IrisSkin2.dll file to the current project reference (solution Resource Manager> current project> reference> right-click to add reference, and find the IrisSkin2.dll file ..... I don't need to talk about it later. ^_^ ). the IrisSkin2.dll file is best placed in the current project \ bin \ Debug file.
2. then, add the IrisSkin2.dll file to the toolbox of vc2005: Right-click and choose items> browse to find the IrisSkin2.dll file (the file is best placed in the current project \ bin \ Debug file) and press OK, control is added to the toolbox. drag the newly added SkinEngine control in the toolbox to the current project.
3. Copy the. ssk file in the skin directory to the \ bin \ Debug file of the current project (optional ).
4. Call the. ssk skin file in the project. Example:
Excerpt:
In WinForm, you can easily add skin to your program and make a variety of brilliant effects. Instead, you only need a few simple codes to get it done. Let's take a look at it.
Preparations:
1. IrisSkin2.dll, the main character of today
2. Skin file with the suffix. ssk
3. A WinForm Program
Step 1:
Add IrisSkin2.dll references to WinForm Solutions
Step 2:
Add a member variable Sunisoft. IrisSkin. SkinEngine se = null to the window class;
Write the following code in the window class constructor:
Se = new Sunisoft. IrisSkin. SkinEngine ();
Se. SkinAllForm = true;
Step 3:
Write the following code in the event where you want to apply skin to your form
Se. SkinFile = "Skins \ Vista1.ssk"; // SkinFile is followed by the path of your ssk file, either relative or absolute.
For example, if you want to press the button button1, you can change the skin of the entire form to the Vista1 style.
Private void button#click (object sender, EventArgs e)
{
Se. SkinFile = "Skins \ Vista1.ssk ";
}
Is it easy?
In this way, your programs can maintain the Vista style even on the operating systems below Vista!
Provides 73 types of skin and IrisSkin2.dll:
Http://cid-934eb8b20470bc75.skydrive.live.com/self.aspx/Public/IrisSkin2%7C0Skins.rar
A WinForm skin manager is specially developed for management of so many skins. Download executable files and source code is provided here:
: Bytes
Follow these steps to change the skin of the Winform interface like MSN. You can select your own skin.
1. Reference The IrisSkin2.dll component (download)
Description: IrisSkin2.dll is a third-party component.
Ii. Code
Change the skin of the Winform Interface
Public partial class Form1: Form
{
Sunisoft. IrisSkin. SkinEngine se = null;
Public Form1 ()
{
InitializeComponent ();
Se = new Sunisoft. IrisSkin. SkinEngine ();
Se. SkinAllForm = true; // This statement is used to set the skin for all forms in the system.
}
Private void Form1_Load (object sender, EventArgs e)
{
}
Private void button#click (object sender, EventArgs e)
{
Se. SkinFile = "skin/SteelBlack. ssk"; // select the skin
}
Private void button2_Click (object sender, EventArgs e)
{
Se. SkinFile = "skin/MSN. ssk"; // select the skin
}
Private void button3_Click (object sender, EventArgs e)
{
Se. SkinFile = "skin/MP10.ssk ";
Form2 f = new Form2 ();
F. Show ();
}
}
Note: "skin/SteelBlack. ssk" is a path where the. ssk file is stored.
Application. StartupPath
Image exchange effect
Private void pictureBox1_MouseLeave (object sender, EventArgs e)
{
// Key
System. Drawing. Bitmap deng = new System. Drawing. Bitmap (Application. StartupPath + "// img/denglu.jpg ");
This. pictureBox1.Image = deng;
}
Private void pictureBox2_MouseMove (object sender, MouseEventArgs e)
{
System. Drawing. Bitmap tuichu2 = new System. Drawing. Bitmap (Application. StartupPath + "// img/tuichu2.jpg ");
This. pictureBox2.Image = tuichu2;
}