关于光标位置解决思路

   阅读
关于光标位置
form中有10多个textbox,如何判断光标在哪个textbox上啊?代码怎么写?

------解决方案--------------------
VB.NET code

#Region ""

    <DllImport("user32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.Winapi)> _
    Friend Shared Function GetFocus() As IntPtr
    End Function

    ''' <summary>
    ''' 获得当前获得焦点的控件
    ''' </summary>
    ''' <returns></returns>
    Private Function GetControl() As Control
        Dim fsControl As Control = Nothing
        Dim fshandle As IntPtr = GetFocus()
        If fshandle <> IntPtr.Zero Then
            fsControl = Control.FromHandle(fshandle)
        End If
        Return fsControl
    End Function

    Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
        Me.Text = "当前焦点控件名称:" + GetControl.Name
    End Sub

#End Region

------解决方案--------------------
Me.ActiveControl.Name
阅读