Hello Guys,
I’m trying to change context menu dynamically depending if the TreeView root is selected I want to use CMnuRoot menu else I want to use CMnuChild menu.
But I’m getting an error: “Object instance is not set to an instance of the object” .
Please help.Code:Private Sub TreeView1_MouseDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseDown If e.Button = MouseButtons.Right and TreeView1.SelectedNode.Parent Is Nothing Then Me.CMnuRoot.Show(Me.TreeView1, New Point(e.X, e.Y)) Else Me.CMnuChild.Show(Me.TreeView1, New Point(e.X, e.Y)) End If End Sub![]()


Reply With Quote