控件(破解版,只限.net2005)和皮肤下载地址:http://www.cnblogs.com/liuxzh1026/archive/2006/08/19/480981.html
嵌入在项目中:
将下载的皮肤文件和irisskin2.rar解压,在项目中添加现有项,将皮肤文件添加进项目;将irisskin2.dll引用进项目。皮肤文件属性中的“生成操作”改为嵌入的资源。引用的irisskin2.dll属性中的“复制本地”改为true。
在代码中添加枚举:
public enum skintype
{
calmness,
deepcyan,
eighteen,
emerald,
glassbrown,
longhorn,
macos,
midsummer,
mp10,
msn,
oneblue,
page,
realone,
silver,
sportsblack,
steelblack,
vista1,
vista2,
warm,
wave,
xpsilver
}
添加调用方法:
public static sunisoft.irisskin.skinengine se=null;
public static void changeskin(skintype st)
{
system.reflection.assembly thisdll = system.reflection.assembly.getexecutingassembly();
if (se == null)
{
se = new sunisoft.irisskin.skinengine(application.openforms[0], thisdll.getmanifestresourcestream("alldj.skin." + st.tostring() + ".ssk"));
se.active = true;
for (int i = 0; i < application.openforms.count; i++)
{
se.addform(application.openforms);
}
}
else
{
se.skinstream = thisdll.getmanifestresourcestream("alldj.skin." + st.tostring() + ".ssk");
se.active = true;
}
}
public static void removeskin()
{
if (se == null)
{
return;
}
else
{
se.active = false;
}
}
调用changeskin方法换肤,调用removeskin方法恢复系统默认皮肤。