Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ToolStrip.AllowDrop Property

Gets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

abstract AllowDrop : bool with get, set 
override AllowDrop : bool with get, set

Property Value

Type: System.Boolean
true to control drag-and-drop and item reordering through events that you implement; otherwise, false.

ExceptionCondition
ArgumentException

AllowDrop and AllowItemReorder are both set to true.

Set the AllowDrop property to true and set the AllowItemReorder property to false to respond to drag-and-drop behavior you have defined in the Control.DragEnter, Control.DragLeave, and Control.DragDrop events.

Set AllowDrop to false and set AllowItemReorder to true to cause the ToolStrip class to handle drag-and-drop and item reordering automatically. Set AllowItemReorder to true for two ToolStrip objects to allow dragging of items from one ToolStrip to the other. To enable the default drag-and-drop, the ALT key must be pressed during the drag operation.

Setting both AllowDrop and AllowItemReorder to true throws an exception.

The following code example demonstrates the syntax for setting common ToolStrip properties, including the AllowDrop property.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft