Step 1
First, add the IrisSkin2.dll file [to the current project reference (solution Resource Manager-> current project-> reference-> right-click-> Add reference, find the IrisSkin2.dll File
The IrisSkin2.dll file is best placed in the current project \ bin \ Debug file. [if it is not put in Debug, it will not be wrong under normal circumstances. However, if you do not place the control after the test, the added control may be difficult to use, that is, you cannot drag it to the form. Therefore, it is best to put it under debug .]
Step 2
Then add the IrisSkin2.dll file to the toolbox of vc2005: Right-click the file and select an item (this will take some time) -> browse to find the IrisSkin2.dll file (the file is best placed in the current project \ bin \ Debug file) and press OK to add the control to the toolbox. drag the newly added SkinEngine control in the toolbox to the current project.
Step 3
Copy the skin. ssk file to the current project \ bin \ Debug file.
Step 4
Drag the skinEngine control and openFileDialog control to the form, and then call the. ssk skin file in the project.
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Text;
Using System. Windows. Forms;
Namespace WindowsApplication1
{
Public partial class Form1: Form
{
Public Form1 ()
{
InitializeComponent ();
}
Private void Form1_Load (object sender, EventArgs e)
{
// This. skinEngine1.SkinFile = "C: \ Documents and Settings \ Administrator \ Desktop \ exercises WindowsApplication1 \ bin \ Debug \ Skins \ XPGreen. ssk ";
}
Private void button#click (object sender, EventArgs e)
{
OpenFileDialog1.Filter = "(*. ssk) | *. ssk | txt files (*. txt) | *. txt"; // file name Filter
OpenFileDialog1.FilterIndex = 1;
OpenFileDialog1.InitialDirectory = "C: \ Documents and Settings \ Administrator \ Desktop \ exercises WindowsApplication1 \ bin \ Debug \ Skins \"; // initial directory
OpenFileDialog1.RestoreDirectory = true;
OpenFileDialog1.FileName = "create folder ";
If (openFileDialog1.ShowDialog () = DialogResult. OK)
{
MessageBox. Show ("successfully changed skin ");
}
}
Private void openFileDialog1_FileOk (object sender, CancelEventArgs e)
{
String name = openFileDialog1.FileName. ToString ();
This. skinEngine1.SkinFile = "C: \ Documents and Settings \ Administrator \ Desktop \ exercises" + name; // open the skin path
}
}
}