在实际工作中,面对不同的客户需求,需要让空间显示出不同的效果.当style已经不能足够满足客户需求时,就需要程序猿自己设计自定义控件了. 根据工作经历,LZ做了个关于自定义控件的小Demo,仅供参考. 实现操作分为三部分,话不多说,直接上代码. 一.控件后台设置 public class ImageButton : Button { public ImageButton() { this.PreviewMouseDown += ImageButton_PreviewMouseDown; this