例如给picturebox添加右键菜单可以这样:
从工具箱拖一个ContextMenuStrip到窗体上,然后自己添加你喜欢的菜单项,然后把PictureBox的ContextMenuStrip属性设置为你你刚添加的哪个ContextMenuStrip,下拉列表里会有你刚刚添加的控件的!
你已经有了“鼠标右键点击的事件”说明你肯定已经有了if e.button=windows.forms.mousebuttons.right then
你只需要找到这条语句,通常这句话应该在你的mouseclick事件中。
这条语句改成
if e.button=windows.forms.mousebuttons.left or e.button=windows.forms.mousebuttons.right then
就可以了!
^_^
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)