Do not close ToolStripMenu on clicking in winforms
问题 I work on a c# winform project that the main toolstripmenu have not to be hide after user clicks on its item, how can I do that? 回答1: Set the AutoClose property of the parent menu item to prevent the menu strip from closing. To demonstrate: ToolStripMenuItem file = new ToolStripMenuItem("File"); file.DropDown.AutoClose = false; file.DropDownItems.Add("New"); file.DropDownItems.Add("Open"); file.DropDownItems.Add("Exit"); MenuStrip ms = new MenuStrip(); ms.Items.Add(file); this.Controls.Add(ms