| | |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | |
| | | this.BackgroundColor = 0x00000000; |
| | | if (!this.GetClick()) { |
| | | return; |
| | | } |
| | | action?.Invoke(this, btnImage, btnName); |
| | | SetHighlightColor(this); |
| | | //按下去改变背景颜色 |
| | | //this.BackgroundColor = AksCommonMethod.seleBackgroundColor; |
| | | |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | this.MouseUpEventHandler += UpClick; |
| | | btnImage.MouseUpEventHandler += UpClick; |
| | | btnName.MouseUpEventHandler += UpClick; |
| | | |
| | | EventHandler<MouseEventArgs> CancelClick = (sender, e) => |
| | | { |
| | | this.BackgroundColor = 0x00000000; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | this.MouseUpOutsideEventHandler += CancelClick; |
| | | btnImage.MouseUpOutsideEventHandler += CancelClick; |
| | | btnName.MouseUpOutsideEventHandler += CancelClick; |
| | | //EventHandler<MouseEventArgs> CancelClick = (sender, e) => |
| | | //{ |
| | | // this.BackgroundColor = 0x00000000; |
| | | // //弹起来还原背景颜色 |
| | | //}; |
| | | //this.MouseUpOutsideEventHandler += CancelClick; |
| | | //btnImage.MouseUpOutsideEventHandler += CancelClick; |
| | | //btnName.MouseUpOutsideEventHandler += CancelClick; |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | |
| | | //按下去改变背景颜色 |
| | | this.BackgroundColor = AksCommonMethod.seleBackgroundColor; |
| | | //EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | //{ |
| | | |
| | | }; |
| | | // //按下去改变背景颜色 |
| | | // this.BackgroundColor = AksCommonMethod.seleBackgroundColor; |
| | | |
| | | this.MouseDownEventHandler += DownClick; |
| | | btnImage.MouseDownEventHandler += DownClick; |
| | | btnName.MouseDownEventHandler += DownClick; |
| | | //}; |
| | | |
| | | //this.MouseDownEventHandler += DownClick; |
| | | //btnImage.MouseDownEventHandler += DownClick; |
| | | //btnName.MouseDownEventHandler += DownClick; |
| | | } |
| | | /// <summary> |
| | | /// 设置图标 |