vb 两个listbox焦点转换问题。
vb两个listbox用左右键来转换焦点,焦点到达时是个框,按向下键才会高亮显示;失去焦点时高亮仍然在。怎么解决啊?希望焦点到达就是高亮,失去焦点高亮就失去。...
vb 两个listbox用左右键来转换焦点,焦点到达时是个框,按向下键才会高亮显示;失去焦点时高亮仍然在。怎么解决啊?
希望焦点到达就是高亮,失去焦点高亮就失去。 展开
希望焦点到达就是高亮,失去焦点高亮就失去。 展开
2010-11-05
展开全部
Private Sub List1_GotFocus(Index As Integer)
List1(Index).BackColor = &H80000005
End Sub
Private Sub List1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 37 Then
List1(0).SetFocus
ElseIf KeyCode = 39 Then
List1(1).SetFocus
End If
End Sub
Private Sub List1_LostFocus(Index As Integer)
List1(Index).BackColor = &H80000000
End Sub
List1(Index).BackColor = &H80000005
End Sub
Private Sub List1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 37 Then
List1(0).SetFocus
ElseIf KeyCode = 39 Then
List1(1).SetFocus
End If
End Sub
Private Sub List1_LostFocus(Index As Integer)
List1(Index).BackColor = &H80000000
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询