Text1.SelStart=0
Text1.SelLength=Len(Text1.Text)

解决方案 »

  1.   

    你的问题我没有明白耶:)
    不过在某个命令结束后:TEXT1。SETFOUCE
      

  2.   

    910.
    我本来也是用你着段代码
    可好象不行,我要把TEXT里的内容选中(即成兰色)
      

  3.   

    Text1.SetFocus
    SendKeys "{Home}+{End}"
      

  4.   

    Option ExplicitPrivate Sub Command1_Click()
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)
    Text1.SetFocus
    End Sub
      

  5.   

    同意楼上,如果你是想把文本框里的内容复制到剪贴板,你可以用APPLICATION.COPY
      

  6.   

    private sub text1_Gotfocus()
    with text1
     .selstart=0
     .sellengh=len(text1.text)
    end withprivate sub command1_click()
    text1.setfocus
    text1_gotfocus
    end sub
      

  7.   

    把代码写在GotFocus事件中!Private Sub Text1_GotFocus()
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1.Text)
    End Sub
      

  8.   

    OldPhoto(雨伞)好点,因为我也是这样