首先要添加外部引用 IrisSkin2.dll
在代码中创建SkinEngine对象
给它的SkinFile赋值一个皮肤文件
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Sunisoft.IrisSkin;
using System.IO;
namespace IrisDemo
{
public partial class Form1 : Form
{
SkinEngine se;
public Form1()
{
InitializeComponent();
se = new SkinEngine();//创建一个皮肤引擎
string[] skinNames = Directory.GetFiles("skins/"); //得到所有皮肤文件路径
comboBox1.Items.AddRange(skinNames);//将皮肤路径添加在下拉选框中
comboBox1.SelectedIndex = 0;//设置默认选中第一个
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
se.SkinFile = comboBox1.SelectedItem.ToString();//为皮肤引擎选择皮肤
}
}
}
