Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

Browse by Tags

All Tags » ContextMenuStrip » Using Controls (RSS)

Sorry, but there are no more tags available to filter with.

  • How can I make a user resizable dropdown?

    Handle WM_NCHITTEST. See http://blogs.msdn.com/jfoscoding/archive/2005/04/20/410231.aspx for more detail.
  • How can I control DropDownDirection?

    DropDownDirection is controlled via two different mechanisms. One is DefaultDropDownDirection offered on ToolStrip, the other is an argument to the Show() method on ToolStripDropDownMenu. TooStrip.DropDownDirection This controls the default direction...
  • How do I dynamically populate a dropdown in the Opening event?

    public partial class Form1 : Form { ContextMenuStrip MyContextMenuStrip = new ContextMenuStrip(); bool CloseClicked = false; public Form1() { InitializeComponent(); // add close item, name it MyContextMenuStrip.Items.Add("Close"); // add separator...
  • How do I prevent a dropdown from closing?

    Two ways, set AutoClose = false, or handle the Closing event and set e.Cancel = true. The Closing event should give you a reason - if you want to prevent the dropdown from being closed when a specific item is clicked - sync the Opening event, hold onto...
  • How can I use the ContextMenuStrip?

    class Form3 : Form { private ContextMenuStrip fruitContextMenuStrip; public Form3() { // new ContextMenuStrip fruitContextMenuStrip = new ContextMenuStrip(); // sync opening event fruitContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler...
  • What is the ContextMenuStrip?

    ContextMenuStrip is the ToolStrip version of ContextMenu. It can be associated with any control and a via secondary click will automatically show. It can also be shown programmatically via the Show() API. It supports an Opening and Closing cancellable...


Page view counter