0

I'm building a web browser in C#. I want to create my own contextmenustrip when right click but I don't know how to it. Can you help me to solve this "open in new tab"?

4

1 回答 1

0

这真的取决于上下文。

例如,如果您在 Windows 窗体上构建它,您可以捕获鼠标按下事件并检查右键单击,之后您可以运行您想要的任何代码,包括打开“上下文菜单条”

this.browser.MouseDown += new System.Windows.Forms.MouseEventHandler(this.browserpanel_MouseDown);

在 browserpanel_MouseDown 中,您可以检查

e.Button == MouseButtons.Right
于 2013-11-15T05:08:20.577 回答