如何得到当前获得焦点的.TEXT

解决方案 »

  1.   

    定义一个模块级变量,然后在每个文本框的GotFocus事件里将能唯一标志本文本框的内容放入这个变量当要检测哪个文本框得到焦点时,只需要测试这个变量的值就行了.祝你好运:)
      

  2.   

    if screen.ActiveControl is text1 then 
    'text1
    elseif screen.ActiveControl is text2 then
    'text2
    end if
      

  3.   

    Dim i
      For i = 1 To n
    If Me.ActiveControl Is Me.Controls("Text" & i) Then
    strTxT = Me.Controls("Text" & i).Text
    Exit For
    End If
    Next n