最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
FT豹豹哥,你给“鼠标左键,弹出contextMenu”的程序
时间:2022-07-02 11:39:38 编辑:袖梨 来源:一聚教程网
由于没有IDE环境,所以程序就尽量简单了
不说了,你看程序吧
using System;
using System.Windows.Forms;
using System.Drawing;
class useonpaint:Form
{
public useonpaint()
{;}
static void Main()
{
Application.Run(new useonpaint());
}
protected override void OnMouseUp(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left) test(e);
}
private void test(MouseEventArgs e)
{
ContextMenu m = new ContextMenu();
this.ContextMenu= m;
// Create MenuItem objects.
MenuItem menuItem1 = new MenuItem();
MenuItem menuItem2 = new MenuItem();
// Set the Text property.
menuItem1.Text = "New";
menuItem2.Text = "Open";
不说了,你看程序吧
using System;
using System.Windows.Forms;
using System.Drawing;
class useonpaint:Form
{
public useonpaint()
{;}
static void Main()
{
Application.Run(new useonpaint());
}
protected override void OnMouseUp(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left) test(e);
}
private void test(MouseEventArgs e)
{
ContextMenu m = new ContextMenu();
this.ContextMenu= m;
// Create MenuItem objects.
MenuItem menuItem1 = new MenuItem();
MenuItem menuItem2 = new MenuItem();
// Set the Text property.
menuItem1.Text = "New";
menuItem2.Text = "Open";
相关文章
- 云星穹铁道权益升级怎么玩 云崩铁权益升级活动介绍 12-03
- 以闪亮之名山中绘梦怎么玩 以闪亮之名滢然花梦套装活动介绍 12-03
- 以闪亮之名绿野梦歌礼包怎么样 以闪亮之名绿野梦歌拍照礼包介绍 12-03
- 光遇12.6有什么更新 光遇12月6日更新内容介绍 12-03
- 伍六七暗影交锋测试资格怎么获得 伍六七暗影交锋内测资格获取方法 12-03
- 无限暖暖晶莹诗集怎么样 12-03