最新下载
热门教程
- 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";
相关文章
- yandex引擎网页版入口-yandex引擎网页版登录2026 05-17
- 三国谋定天下庞统厉害吗 05-17
- QQ经典版app下载安装-QQ经典版app官方最新版iOS苹果版下载入口 05-17
- 逆战未来天网效果如何 05-17
- 爱发电APP已购内容如何下载与离线观看 05-17
- 高德地图怎样开启省电模式 05-17