簡體   English   中英

窗體運行時,不顯示上下文菜單項

[英]Context Menu Item is not showing when form is running

我在Windows窗體應用程序上創建了上下文菜單項。 但是當我運行應用程序時,當我嘗試右鍵單擊時,創建的菜單項沒有顯示出來

在此輸入圖像描述

我的代碼:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

您必須在表單上設置ContextMenuStrip屬性或您希望它與之關聯的任何控件:

在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM