开发winform换肤控件 我想用c#开发一个winform的换肤控件,类似于iriskin那种的,谁有这方面的例子或者源程序,或者是示例之类的参考呢。请联系我好么,我的qq455518637或者e_mail给我,[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 感觉你可以考虑 制作ssk皮肤iriskin这个已经很好了或者用dotnetbar skin的那个皮肤太少了,而且都不是很漂亮,最主要的是有BUG,屏幕会闪烁 现有的控件ssk、iriskin、dotnetbar这些已经非常不错了!如果自己想做,建议从简单的TextBox,Label等开始,一般都是都是重载这些控件,加载一些改变边框和背景的方法,自己定义一个INI皮肤文件就可以了,在重载过程中读取这个INI文件。例如的我INI文件部分定义为:[MYButton]clrBorder=90,90,0normalInner1=248,252,253normalInner2=172,171,201normalInnerBorderClr=100,149,237hoverInnerBorderClr=244,164,96pressInnerBorderClr=255,140,0disBody=245,244,234disBorder=201,199,186[MYListBox]borderColor=100,149,237[MYButton]normalBorderColor=99,166,181normalBodyColor=255,255,255normalArrowColor=154,209,215mouseOnBorderColor=99,166,181mouseOnBodyColor=255,255,255mouseOnArrowColor=39,174,206disBodyColor=235,235,235disBorderColor=99,166,181disArrowColor=210,210,210 www.csharpwin.com当初自己做控件,就是学的这个上面得例子。 开发换肤需要对.net的控件描绘有很深的研究,可以先研究一下控件重绘。换肤不太容易做。 像dotnetbar这种换肤的软件应该是通过使用系统钩子来实现的吧! 看看这个,codeproject上的源代码,可以参考一下:GUI Skinning System for Windows Forms .NEThttp://www.codeproject.com/KB/miscctrl/guiss.aspx 这还有一个VC实现的:Winforms SkinFramework(VC)http://www.codeproject.com/KB/dialog/SkinFramework.aspx 用skinEngine控件using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using System.Configuration;namespace 换肤演示{ public partial class Form1 : Form { public Form1() { InitializeComponent(); skinEngine1.SkinFile = ConfigurationManager.AppSettings["skin"].ToString(); } private void LoadSkin() { string[] files = Directory.GetFiles("skin", "*.ssk"); if (files != null) { foreach (string filename in files) { string str = filename.Substring(5); str = str.Substring(0, str.Length - 4); ToolStripItem tsi=tsmiSkin.DropDownItems.Add(str); tsi.Tag = filename; tsi.Click += new EventHandler(Skin_Click); } } } void Skin_Click(object sender, EventArgs e) { ToolStripItem mnu = sender as ToolStripItem; skinEngine1.SkinFile = mnu.Tag.ToString(); //保存到app.config Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings["skin"].Value = mnu.Tag as string; config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings"); } private void tsmiExit_Click(object sender, EventArgs e) { this.Dispose(); } private void Form1_Load(object sender, EventArgs e) { LoadSkin(); } }} public partial class Form1:Form{ public Form1() { InitializeComponent(); this.skinEngine1.SkinFile="*.ssk"; }}//要先导入皮肤控件 我想的是开发自己的皮肤控件,而不是用别人的,如果是自己开发的,我想对我有用iamxiaowu。 用wpf漂亮简单美观大方!就是你的电脑必须能跑的动! 我觉着不大好,wpf必须是3.0以上框架 http://qq273322093.download.csdn.net/这个感觉真的不错。 程序运行中控件都变成大红叉啦!!! 命名空间是什么意思? 大家都在做什么项目啊? 难题!通过IE控制客户端,可行吗? 求助:有谁能解决下列这些问题,最近参加培训考试急用,谢谢 WinForm下如何将DataSet绑定到RadioButton 第一次发帖 求救 关于.net 短信平台 乱码问题 麻烦大家看看看问题出在哪里?? 调用dll的问题 请问各位大侠,还有什么关于C#的书呀,除了<<C#教程>>呦 求.net Reflector7.0插件 关于字符串替换问题。谢谢!
iriskin这个已经很好了
或者用dotnetbar
例如的我INI文件部分定义为:[MYButton]
clrBorder=90,90,0
normalInner1=248,252,253
normalInner2=172,171,201
normalInnerBorderClr=100,149,237
hoverInnerBorderClr=244,164,96
pressInnerBorderClr=255,140,0
disBody=245,244,234
disBorder=201,199,186[MYListBox]
borderColor=100,149,237[MYButton]
normalBorderColor=99,166,181
normalBodyColor=255,255,255
normalArrowColor=154,209,215
mouseOnBorderColor=99,166,181
mouseOnBodyColor=255,255,255
mouseOnArrowColor=39,174,206
disBodyColor=235,235,235
disBorderColor=99,166,181
disArrowColor=210,210,210
GUI Skinning System for Windows Forms .NET
http://www.codeproject.com/KB/miscctrl/guiss.aspx
Winforms SkinFramework(VC)
http://www.codeproject.com/KB/dialog/SkinFramework.aspx
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Configuration;namespace 换肤演示
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
skinEngine1.SkinFile = ConfigurationManager.AppSettings["skin"].ToString();
} private void LoadSkin()
{
string[] files = Directory.GetFiles("skin", "*.ssk");
if (files != null)
{
foreach (string filename in files)
{
string str = filename.Substring(5);
str = str.Substring(0, str.Length - 4);
ToolStripItem tsi=tsmiSkin.DropDownItems.Add(str);
tsi.Tag = filename;
tsi.Click += new EventHandler(Skin_Click);
}
}
} void Skin_Click(object sender, EventArgs e)
{
ToolStripItem mnu = sender as ToolStripItem;
skinEngine1.SkinFile = mnu.Tag.ToString();
//保存到app.config
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["skin"].Value = mnu.Tag as string;
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
} private void tsmiExit_Click(object sender, EventArgs e)
{
this.Dispose();
} private void Form1_Load(object sender, EventArgs e)
{
LoadSkin();
} }
}
{
public Form1()
{
InitializeComponent();
this.skinEngine1.SkinFile="*.ssk";
}
}
//要先导入皮肤控件