日期:2010-01-06 浏览次数:20503 次
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.Drawing.Drawing2D;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- namespace MyControls
- {
- public partial class CrystalButton : Button
- {
- private enum MouseActionType
- {
- None,
- Hover,
- Click
- }
- private MouseActionType mouseAction;
- private ImageAttributes imgAttr = new ImageAttributes();
- private Bitmap buttonBitmap;
- private Rectangle buttonBitmapRectangle;
- public CrystalButton()
- {
- InitializeComponent();
- mouseAction = MouseActionType.None;
- this.SetStyle(ControlStyles.AllPaintingInWmPaint
- ControlStyles.DoubleBuffer