`
hzy3774
  • 浏览: 985428 次
  • 性别: Icon_minigender_1
  • 来自: 珠海
社区版块
存档分类
最新评论

C#中使用IrisSkin进行美化

 
阅读更多


首先要添加外部引用 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();//为皮肤引擎选择皮肤
         }
     }
 }


  • 大小: 26.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics