vb 双击目录树中的节点如何使节点获得焦点
1个回答
展开全部
节点失去焦点有两种情况
1、treeview失去焦点,可以在LostFocus事件中处理
2、人为让所选的节点非高亮显示
Private Sub TreeView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nd As Node
Set nd = TreeView1.HitTest(x, y)
If Button = vbLeftButton Then
If nd Is Nothing Then '点击空白处
TreeView1.SelectedItem = Nothing
'在这里处理
End If
End If
End Sub
1、treeview失去焦点,可以在LostFocus事件中处理
2、人为让所选的节点非高亮显示
Private Sub TreeView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nd As Node
Set nd = TreeView1.HitTest(x, y)
If Button = vbLeftButton Then
If nd Is Nothing Then '点击空白处
TreeView1.SelectedItem = Nothing
'在这里处理
End If
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询