1 怎么让一个txt得到焦点后且是**选中**状态(反白显法)
2
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then SendKeys "{Tab}"End Subkeypreview 也设为true了,但为什么焦点不变换呢?有时好用有时不好用?
2
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then SendKeys "{Tab}"End Subkeypreview 也设为true了,但为什么焦点不变换呢?有时好用有时不好用?
SendKeys "{home}+{end}"
End Sub
我也给放到Form_KeyDown事件下了。也没好用。不知为什么了
反白显示记得用:SelStart属性和SelLength可以实现。忘了
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
2、
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then SendKeys "{Tab}"
End Sub
text1.sellength=len(text1.text)
If KeyAscii = vbKeyReturn Then SendKeys "{Tab}"
End Sub
这个也不好用啊。