我正在尝试触发 a 的鼠标右键单击事件Panel
并调用一个函数,但它没有触发。这是我的代码:
private void viewscreen_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
generate_editpanel();
}
}
“视屏”是一个Panel
. 我的设计师代码是:
// viewscreen
//
this.viewscreen.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.viewscreen.Location = new System.Drawing.Point(208, 16);
this.viewscreen.Name = "viewscreen";
this.viewscreen.Size = new System.Drawing.Size(370, 289);
this.viewscreen.TabIndex = 0;
this.viewscreen.MouseClick +=
new System.Windows.Forms.MouseEventHandler(this.viewscreen_MouseClick);
谁能帮我?