If e.Button = MouseButtons.Right Then \'假定按下的是鼠标右键
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim node As WinForm.TreeNode = trv.SelectedNode
If node.Level = 1
ContextMenus("快捷菜单1").Show(e.Sender,e.x,e.y) \'则在鼠标位置显示快捷菜单
Else
ContextMenus("快捷菜单2").Show(e.Sender,e.x,e.y) \'则在鼠标位置显示快捷菜单
End If
End If