Skip to content

How to use context menu in windows form

Andrei Arugay

Asked Oct 16, 2004, 8:51 PM EDT1 answer
Share
LinkedInX
Can anyone give me a code on context menu in windows form within a form's control or in user control? I appreciate your help! A.M.A.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Look at this code. ContextMenu cm = new ContextMenu(); MenuItem m1 = new MenuItem("MenuItem 1"); MenuItem[] subItems = new MenuItem[] { new MenuItem("SubItem 2.1") , new MenuItem("MenuItem 2.2") }; MenuItem m2 = new MenuItem("MenuItem 2" ,subItems); cm.MenuItems.Add(m1); cm.MenuItems.Add(m2); cm.Show(Form1 ,Cursor.Position); I hope this helps a little
    0