由于文本框内容太长,导致如果用普通的选择方式只看到文本后面的内容
Text1.SelStart = 0
Text1.SelLength = 100
想是否有即能全选又让光标在行首.试过SendMessage(EM_SETSEL),SetCartetPos等API函数,都没成功,只好用键盘模拟,先按END再按SHIFT+HOME,不过前提是先要把光标放在文本框中.
Text1.SetFocus
keybd_event vbKeyEnd, 0, 1, 0
keybd_event vbKeyShift, 0, 0, 0
keybd_event vbKeyHome, 0, 1, 0
keybd_event vbKeyShift, 0, 2, 0