XP-Style Button
原文:http://www.codeproject.com/cs/miscctrl/xp-style_button.asp
我修改了二个小小的地方:
1. 在VS里添加的时候出来了二个控件.ButtonBase 与 ButtonXP ,其实只要ButtonXP这个的.把ButtonBase.cs里Class前加一点代码,改后如下:
2. 在VS里的工具栏加好这控件后.拖过来那buttonxp的大小只有10*10,实现是太小了.一个小点点.把他拖大是在考你的鼠标功底^_^..不小心就提示错误(那提示的错误我忘记了),就出错不可以用了.把ButtonBase.cs这个文件改一下就OK了.具体如下:
大约是60行的:
改为:
3. 他例子里(XP-Style_Button_demo\TestApp\Form1.cs)
其实这个不用都可以. 开始我看他例子里有这个.我也加上.结果设计模式没有了.不要这个.也就是不要管他.直接拖过控件过来就可以用了.不用改这里.
还是VS自动生成的:
我修改了二个小小的地方:
1. 在VS里添加的时候出来了二个控件.ButtonBase 与 ButtonXP ,其实只要ButtonXP这个的.把ButtonBase.cs里Class前加一点代码,改后如下:
namespace PinkieControls
{
[DesignTimeVisible(false), ToolboxItem(false)]
public class ButtonBase: System.Windows.Forms.Control, IButtonControl
{
//
}
}
{
[DesignTimeVisible(false), ToolboxItem(false)]
public class ButtonBase: System.Windows.Forms.Control, IButtonControl
{
//
}
}
2. 在VS里的工具栏加好这控件后.拖过来那buttonxp的大小只有10*10,实现是太小了.一个小点点.把他拖大是在考你的鼠标功底^_^..不小心就提示错误(那提示的错误我忘记了),就出错不可以用了.把ButtonBase.cs这个文件改一下就OK了.具体如下:
大约是60行的:
this.Size = new Size(10,10);
改为:
this.Size = new Size(75, 25);
3. 他例子里(XP-Style_Button_demo\TestApp\Form1.cs)
public class Form1 : PinkieControls.FormEx
其实这个不用都可以. 开始我看他例子里有这个.我也加上.结果设计模式没有了.不要这个.也就是不要管他.直接拖过控件过来就可以用了.不用改这里.
还是VS自动生成的:
public class AboutMe : System.Windows.Forms.Form