The context menu item does not appear when the form is running.

I created a context menu item in a Windows forms application. But when I launch the application, and when I try to right-click, the created menu item does not appear

enter image description here

My code is:

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) { } } } 
+5
source share
1 answer

You must set the ContextMenuStrip property in your form or in any control you want to associate with:

enter image description here

+6
source

All Articles