Skip to content

Commit 8c56ad3

Browse files
dsychinRon Petrusha
authored andcommitted
simplify description (#2446)
1 parent 4dd2459 commit 8c56ad3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

xml/System.Windows.Forms/Control.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14276,15 +14276,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
1427614276

1427714277

1427814278
## Examples
14279-
The following code example demonstrates a drag-and-drop operation between two <xref:System.Windows.Forms.ListBox> controls. The example calls the <xref:System.Windows.Forms.Control.DoDragDrop%2A> method when the drag action starts. The drag action starts if the mouse has moved more than <xref:System.Windows.Forms.SystemInformation.DragSize%2A?displayProperty=nameWithType> from the mouse location during the <xref:System.Windows.Forms.Control.MouseDown> event. The <xref:System.Windows.Forms.ListBox.IndexFromPoint%2A> method is used to determine the index of the item to drag during the `MouseDown` event.
14280-
14281-
The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files,`3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck`<xref:System.Windows.Forms.CheckBox> is checked. The custom cursors are set in the <xref:System.Windows.Forms.Control.GiveFeedback> event handler.
14282-
14283-
The keyboard state is evaluated in the <xref:System.Windows.Forms.Control.DragOver> event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the <xref:System.Windows.Forms.DragEventArgs.Effect%2A?displayProperty=nameWithType> is set to `None` in <xref:System.Windows.Forms.DragDropEffects>. Finally, the status of the drop is displayed in the `DropLocationLabel`<xref:System.Windows.Forms.Label>.
14284-
14285-
The data to drop for the right `ListBox` is determined in the <xref:System.Windows.Forms.Control.DragDrop> event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the <xref:System.Windows.Forms.Control.QueryContinueDrag> event handler.
14286-
14287-
This code excerpt demonstrates using the <xref:System.Windows.Forms.Control.QueryContinueDrag> event. See the <xref:System.Windows.Forms.Control.DoDragDrop%2A> method for the complete code example.
14279+
This code excerpt demonstrates using the <xref:System.Windows.Forms.Control.QueryContinueDrag> event to cancel the drag-and-drop operation if the drag operation moves outside the bounds of the form. See the <xref:System.Windows.Forms.Control.DoDragDrop%2A> method for the complete code example.
1428814280

1428914281
[!code-cpp[System.Windows.Forms.Control.DoDragDrop#6](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp#6)]
1429014282
[!code-csharp[System.Windows.Forms.Control.DoDragDrop#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CS/form1.cs#6)]

0 commit comments

Comments
 (0)