Need to edge out the competition for your dream job? Train for certifications today.
Public Class Form1
Private Sub TreeView1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
Dim tn As TreeNode = TreeView1.GetNodeAt(e.X, e.Y)
If Not IsNothing(tn) Then
Dim rc As Rectangle = TreeView1.RectangleToScreen(tn.Bounds)
Dim f2 As New Form2
f2.StartPosition = FormStartPosition.Manual
f2.Location = New Point(rc.X, rc.Bottom)
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.