关于KeyDown 事件问题

CraxyMouse CraxyMouse 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我继承了UserControl写了一个控件

我现在添加了一个linklabel后就不能触发KeyDown事件了,移除后又可以正常触发了?
现不知道如何修改?望指点!


private void InitializeComponent()
{
LinkLabel lkBlog = new LinkLabel();
this.SuspendLayout();

//
// Designer
//
this.Name = "Designer";
this.MouseLeave += new System.EventHandler(this.Designer_MouseLeave);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Designer_Paint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Designer_MouseMove);
this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Designer_MouseDoubleClick);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Designer_MouseDown);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Designer_KeyPress);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Designer_MouseUp);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Designer_KeyDown);
this.KeyUp += new KeyEventHandler(Designer_KeyUp);


lkBlog.Location = new Point(10, 10);
lkBlog.AutoSize = true;
lkBlog.Text = "My Blog:http://blog.csdn.net/dunao(点击访问)";
lkBlog.Click += new EventHandler(lkBlog_Click);

this.Controls.Add(lkBlog);

this.ResumeLayout(false);

}
...全文
评论 10
收藏 已收藏
分享
返回顶部
CraxyMouse
C# 111,129 成员 642,540 内容