怎样选定文本框里的全部内容,就像在IE里按F6键选定地址栏的效果一样

解决方案 »

  1.   

    text1.selstart=0
    text1.sellength=len(text1.text)
      

  2.   

    Private Sub Text1_GotFocus()
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1.Text)
    End Sub
      

  3.   

    Private Sub txtFee_GotFocus()
        Call SelectTextValue(txtFee)
    End Sub'********************************************************************************
    '*   功能  描述:指定的文本编辑控件内容为选中状态
    '*   参数  说明:
    '*         输入:文本编辑控件txt
    '*         输出:None
    '*   返回值说明:None
    '*   作      者:Ajiu
    '*   更      新:
    '*   创建  日期:2003/3/25
    '*   更新  日期:
    '********************************************************************************
    Private Sub txtFee_GotFocus()
        Call SelectTextValue(txtFee)
    End Sub
      

  4.   

    Text1.SetFocus '文本框得到焦点
    Text1.SelStart = 0  '从文本第几位开始
    Text1.SelLength =len(text1.text) '共几位
      

  5.   

    Text1.SelLength = Len(Text1.Text)