txt的lostfocus中如何获得鼠标点击的下一个控件是什么
如题
做了一个软键盘,想在焦点离开txt时判断下个获得焦点的控件如不是txt或者软键盘时把软键盘关掉。
在lostfocus中用ActiveControl获得的还是当前控件,怎么知道鼠标点的下一个控件是什么?
或者提供下思路,有其他方法关掉软键盘 lostfocus?焦点
[解决办法]
Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus, TextBox2.GotFocus, TextBox3.GotFocus
GroupBox1.Show() '获得焦点显示软键盘
End Sub
Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus, TextBox2.LostFocus, TextBox3.LostFocus
For Each a As Control In Me.Controls
If a.Focused = True And a.GetType.ToString <> "System.Windows.Forms.TextBox" Then
GroupBox1.Hide() '失去焦点隐藏软键盘
End If
Next
End Sub