N
Nickneem
I have a treeview with which I want to use a context menu for certain
nodes to fill a memo property of the node.
So when I add the nodes I set a property 'ItemNode' to either true or
false.
If the ItemNode is true I want the contextmenu to pop-up if not I want
to prevent it from popping up.
Here's my code which won't work...
Private Sub ContextMenu1_Popup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ContextMenu1.Popup
Dim rClickedNode As InheritTreeNode
Try
rClickedNode = CType(treeMenu.SelectedNode,
InheritTreeNode)
If rClickedNode.ItemNode = False Then
MsgBox("Memo's only available for items!")
Me.Focus()
Dim hWnd As IntPtr = GetFocus()
SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0)
SendMessage(hWnd, WM_LBUTTONUP, 0, 0)
End If
Catch ex As Exception
End Try
End Sub
Thanks in advance,
Mike
nodes to fill a memo property of the node.
So when I add the nodes I set a property 'ItemNode' to either true or
false.
If the ItemNode is true I want the contextmenu to pop-up if not I want
to prevent it from popping up.
Here's my code which won't work...
Private Sub ContextMenu1_Popup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ContextMenu1.Popup
Dim rClickedNode As InheritTreeNode
Try
rClickedNode = CType(treeMenu.SelectedNode,
InheritTreeNode)
If rClickedNode.ItemNode = False Then
MsgBox("Memo's only available for items!")
Me.Focus()
Dim hWnd As IntPtr = GetFocus()
SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0)
SendMessage(hWnd, WM_LBUTTONUP, 0, 0)
End If
Catch ex As Exception
End Try
End Sub
Thanks in advance,
Mike