using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Collections;namespace UseSkin{ public partial class Form1 : Form { Sunisoft.IrisSkin.SkinEngine skin = new Sunisoft.IrisSkin.SkinEngine(); int intCount = 0; ArrayList arraylist = new ArrayList(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { foreach (string filename in Directory.GetFiles(Directory.GetCurrentDirectory() "\\skins")) { arraylist.Add(filename); } } private void button1_Click(object sender, EventArgs e) { changeSkin( true); } private void button2_Click(object sender, EventArgs e) { changeSkin( false ); } private void changeSkin(bool bolplus) { if (bolplus) { if (intCount < arraylist.Count) intCount ; else intCount = 0; } else { if (intCount > 0) { intCount--; } else { intCount = arraylist.Count; } } string skinname = ""; for(int i=0;i<arraylist .Count ;i ) { if (i ==(intCount-1)) { skin.SkinFile = arraylist[i].ToString(); skinname = arraylist[i].ToString(); skin.Active = true; label1.Text = "第" intCount.ToString() "个皮肤"; label2.Text = skinname; break; } } } private void toolStripButton1_Click(object sender, EventArgs e) { Form2 f = new Form2(); f.ShowDialog(); } private void button3_Click(object sender, EventArgs e) { File.Delete(label2.Text); } }}
评论