B
Barkingmadscot
I am try to find out how to check if the mouse button is held down.
The e.click =2 works, it allows me to enter the double click double.
I what the single click to do some different and then a click and
hold
to allow the drag and drop
I have looked at the mouseUp events be can not get it to work, when i
click and release my code does not enter mouseUP event?
See above for MouseDown Event
any ideas
Thanks
Barry
Private Sub tvNone_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles tvNone.MouseDown
Select Case e.Button.ToString
Case "Left"
If e.Clicks = 2 Then Exit Sub '# Exits to Double
click
event
If tvNone.SelectedNode Is Nothing Then Exit Sub '#
Exits if nothing is selected
'# Enable Treeview that node can be dropped into
Me.tvNone.AllowDrop = True
Me.tvRFQ.AllowDrop = True
Me.tvEnquiry.AllowDrop = False
Me.tvEval.AllowDrop = False
Me.tvRPT.AllowDrop = False
Me.tvPO.AllowDrop = False
Me.tvRAS.AllowDrop = False
Me.tvITD.AllowDrop = False
Me.tvRAD.AllowDrop = False
'# Get Selected node and node index
Dim DraggedNode As String = tvNone.SelectedNode.Text
Dim DraggedNodeIndex As Integer =
tvNone.SelectedNode.Index
'# Send info to DragDrag events
tvNone.DoDragDrop(Chr(40) & DraggedNode & Chr(41) &
Chr(40) & 0 & Chr(41), DragDropEffects.Move)
'# Remove Selected Node
tvNone.Nodes.RemoveAt(DraggedNodeIndex)
Case "Middle"
Case "Right"
End Select
End Sub
The e.click =2 works, it allows me to enter the double click double.
I what the single click to do some different and then a click and
hold
to allow the drag and drop
I have looked at the mouseUp events be can not get it to work, when i
click and release my code does not enter mouseUP event?
See above for MouseDown Event
any ideas
Thanks
Barry
Private Sub tvNone_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles tvNone.MouseDown
Select Case e.Button.ToString
Case "Left"
If e.Clicks = 2 Then Exit Sub '# Exits to Double
click
event
If tvNone.SelectedNode Is Nothing Then Exit Sub '#
Exits if nothing is selected
'# Enable Treeview that node can be dropped into
Me.tvNone.AllowDrop = True
Me.tvRFQ.AllowDrop = True
Me.tvEnquiry.AllowDrop = False
Me.tvEval.AllowDrop = False
Me.tvRPT.AllowDrop = False
Me.tvPO.AllowDrop = False
Me.tvRAS.AllowDrop = False
Me.tvITD.AllowDrop = False
Me.tvRAD.AllowDrop = False
'# Get Selected node and node index
Dim DraggedNode As String = tvNone.SelectedNode.Text
Dim DraggedNodeIndex As Integer =
tvNone.SelectedNode.Index
'# Send info to DragDrag events
tvNone.DoDragDrop(Chr(40) & DraggedNode & Chr(41) &
Chr(40) & 0 & Chr(41), DragDropEffects.Move)
'# Remove Selected Node
tvNone.Nodes.RemoveAt(DraggedNodeIndex)
Case "Middle"
Case "Right"
End Select
End Sub