您的位置:程序门 -> vb -> 基础类



怎么在text文本获得焦点后整个文本文字被选上?怎么没有select属性啊


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


怎么在text文本获得焦点后整个文本文字被选上?怎么没有select属性啊
发表于:2007-02-05 09:40:29 楼主
怎么在text文本获得焦点后整个文本文字被选上?怎么没有select属性啊?我想选上后我直接可以输入数据,不用人为的选中然后删除内容了
发表于:2007-02-05 09:55:131楼 得分:0
text1.selstart=0
text1.sellength   =   len(text1.text)
发表于:2007-02-05 10:04:022楼 得分:0
可以
  private       sub       text1_gotfocus()      
                    text1.selstart       =       0      
                    text1.sellength       =       len(text1.text)      
    end       sub      
发表于:2007-02-05 10:05:263楼 得分:0
text1.selstart=0
text1.sellength   =   len(text1)
发表于:2007-02-05 10:14:154楼 得分:0
private   sub   command1_click()
        text1.setfocus
        text1.selstart   =   0
        text1.sellength   =   len(text1.text)
end   sub
发表于:2007-02-05 10:16:595楼 得分:0
多谢,结帖
发表于:2007-02-05 16:09:506楼 得分:0
不用这么麻烦吧
直接用
text1.setfocus
sendkeys   "{home}+{end} "


快速检索

最新资讯
热门点击