首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

给picturebox控件写一个click事件 为何没反应

2013-03-04 
给picturebox控件写一个click事件 为什么没反应[解决办法]public class tank : PictureBox{public delegat

给picturebox控件写一个click事件 为什么没反应

                            
[解决办法]
public class tank : PictureBox
        {
            public delegate void mykprs(object sender, MouseEventArgs e);
            public event mykprs yourkeypress;
            protected override void OnMouseClick(MouseEventArgs e)
            {
                if (yourkeypress != null)
                    yourkeypress(this, e);
                base.OnMouseClick(e);
            }
        }

热点排行