forum

Home / DeveloperSection / Forums / ToolStripMenuItem and KeyPress or KeyDown event

ToolStripMenuItem and KeyPress or KeyDown event

Anonymous User 4370 28-Jan-2014

I am using ToolStripDropDownButton and dynamically adding menu items as below:

toolStripDropDownButton1.DropDownItems.Clear();

ToolStripMenuItem item1 = new ToolStripMenuItem("Item1");

toolStripDropDownButton1.DropDownItems.Add(item1);

ToolStripMenuItem item2 = new ToolStripMenuItem("Item2");

toolStripDropDownButton1.DropDownItems.Add(item2);

I would like to delete the selected menu item when the Delete key is pressed. But the ToolStripMenuItem doesn't have KeyPress or KeyDown event.

I am using Visual Studio 2010 and .NET 4.0. Any suggestions on how to achieve this functionality?


c# c# 
Updated on 28-Jan-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By