Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Context Menu Item is not showing when form is running

I have created context menu item on windows forms application. But when i run the application and when i try to right click, created menu item is not showing up

enter image description here

My Code:

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)
        {

        }
    }
}
like image 618
user1030181 Avatar asked May 27 '16 15:05

user1030181


Video Answer


1 Answers

You have to set the ContextMenuStrip property on your form or whatever control you want it to be associated with:

enter image description here

like image 89
rory.ap Avatar answered Sep 19 '22 12:09

rory.ap