Posted 19 years ago
by Jan
- Germany
SyntaxEditor .NET Control v3.1.0200, .NET 2.0, Windows XP
Hallo,
i have to implement a program location arrow drag & drop action like in visual studio.
But i can't find any solution to customize the Effect property of the Drag&Drop action.
In the documentation i read i have to use the PasteDragDrop Eventhandler in place of the general DragEnter event.
So my first try looks like this:in the PasteDragDrop handler the codeline to change the dragDropEffect seems to have no affect.
does someone know what i'm doing wrong, or does example code for this standard feature exists?
[Modified at 03/27/2006 01:15 AM]
Hallo,
i have to implement a program location arrow drag & drop action like in visual studio.
But i can't find any solution to customize the Effect property of the Drag&Drop action.
In the documentation i read i have to use the PasteDragDrop Eventhandler in place of the general DragEnter event.
So my first try looks like this:
Private Sub SyntaxEditor1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SyntaxEditor1.MouseDown
If IsMouseHoveringDebugArrow(e.location) Then
Me.DoDragDrop(Me.mArrowIndicator, DragDropEffects.Move)
End If
End Sub
Private Function IsMouseHoveringDebugArrow(ByVal mouseLocation As Point) As Boolean
If mouseLocation.X > SyntaxEditor1.IndicatorMarginWidth Then Return False
Dim position As Position = SyntaxEditor1.SelectedView.PositionFromLocation(mouseLocation, LocationToOffsetAlgorithm.BestFit)
Dim offset As Integer = SyntaxEditor1.Document.PositionToOffset(position)
Dim nextOffset As Integer = SyntaxEditor1.Document.PositionToOffset(New Position(Math.Min(position.Line + 1, SyntaxEditor1.Document.Lines.Count - 1), 0))
If mArrowIndicator.Offset >= offset AndAlso mArrowIndicator.Offset <= nextOffset Then Return True
Return False
End Function
Private Sub SyntaxEditor1_PasteDragDrop(ByVal sender As System.Object, ByVal e As ActiproSoftware.SyntaxEditor.PasteDragDropEventArgs) Handles SyntaxEditor1.PasteDragDrop
If e.Source = PasteDragDropSource.DragEnter Then
If e.DragEventArgs.Data.GetDataPresent(mArrowIndicator.GetType()) Then
e.DragEventArgs.Effect = DragDropEffects.Move
End If
End If
End Sub
does someone know what i'm doing wrong, or does example code for this standard feature exists?
[Modified at 03/27/2006 01:15 AM]