资源简介
c# winform 超漂亮按钮 控件,一个自定义控件,一个重写button类
代码片段和文件信息
using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing.Drawing2D;
namespace CRB.Platform.WinUI.Core.WorkflowOp.Ctrl
{
///
/// A replacement for the Windows Button Control.
///
[DefaultEvent(“Click“)]
public class BeautyButton : System.Windows.Forms.UserControl
{
#region - Designer -
private System.ComponentModel.Container components = null;
///
/// Initialize the component with it‘s
/// default settings.
///
public BeautyButton()
{
InitializeComponent();
this.Setstyle(Controlstyles.AllPaintingInWmPaint true);
this.Setstyle(Controlstyles.DoubleBuffer true);
this.Setstyle(Controlstyles.ResizeRedraw true);
this.Setstyle(Controlstyles.Selectable true);
this.Setstyle(Controlstyles.SupportsTransparentBackColor true);
this.Setstyle(Controlstyles.UserPaint true);
this.BackColor = Color.Transparent;
mFadeIn.Interval = 30;
mFadeOut.Interval = 30;
}
///
/// Release resources used by the control.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region - Component Designer generated code -
private void InitializeComponent()
{
//
// VistaButton
//
this.Name = “VistaButton“;
this.Size = new System.Drawing.Size(100 32);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.VistaButton_Paint);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.VistaButton_KeyUp);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VistaButton_KeyDown);
this.MouseEnter += new System.EventHandler(this.VistaButton_MouseEnter);
this.MouseLeave += new System.EventHandler(this.VistaButton_MouseLeave);
this.MouseUp +=new MouseEventHandler(VistaButton_MouseUp);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.VistaButton_MouseDown);
this.GotFocus +=new EventHandler(VistaButton_MouseEnter);
this.LostFocus +=new EventHandler(VistaButton_MouseLeave);
this.mFadeIn.Tick += new EventHandler(mFadeIn_Tick);
this.mFadeOut.Tick += new EventHandler(mFadeOut_Tick);
this.Resize +=new EventHandler(VistaButton_Resize);
}
#endregion
#endregion
#region - Enums -
///
/// A private enumeration that determines
/// the mouse state in relation to the
/// current instance of the control.
///
enum State {None Hover Pressed};
///
/// A public enumeration that determines whether
/// the button background is painted when the
/// mouse is not inside the ClientArea.
///
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4791 2016-11-29 14:58 CrystalButton.cs
文件 21950 2016-11-29 14:29 BeautyButton.cs
文件 6440 2016-11-29 14:24 BeautyButton.resx
----------- --------- ---------- ----- ----
33181 3
- 上一篇:传智播客wpf基础视频教程(第三季).txt
- 下一篇:C#写的 模拟 cmd界面
相关资源
- C#初级不涉及数据库的学生成绩管理系
- C#制作PDF以及源代码.rar
- 单像空间后方交会C#版
- C# Excel导入导出
- 适合于WinCE应用开发的压缩解压缩库
- C#监控剪切板
- 对C#的树型控件TREEVIEW添加背景图片
- 用c#写的五子棋源代码
- C#中在picturebox中实时画矩形框
- C#在一块空间中鼠标中键操作图像
- C#制作qq截图自动框选功能
- 显示所有缓存 清除所有缓存 Asp.net(
- C#自动截屏/定时截屏/自动保存/快捷键
- C# 通过鼠标滚轮实现缩放图片和移动
- C# 动态生成RDLC报表
- C#调用考勤机API读取记录
- c# 真正的线控件直线、斜线而且不会
- C#写的 模拟 cmd界面
- C# 内存处理器、网络上行与下行实时
- 仿QQ的C#源码、仿QQ的C#源码
- C#版人机对弈五子棋
- MPU6050 实时图表上位机 C#
- C#编码实现的开心消消乐游戏
- C# 计算机行为监控
- 定时调用接口小工具.zip
- C#实现shp文件的读取和显示程序
- 国密算法SM2、SM3、SM4的C#源码
- C# 模拟电梯控制源码
- C#节点的使用.zip
- C# 绘图 GDI
评论
共有 条评论