Click to See Complete Forum and Search --> : Selecting everything by TAB key


chem1
January 27th, 2000, 05:55 AM
Hello,
I am trying to TAB to one text box from another and I want whole of the test to be selected when I TAB into the next field,
Any Help,
Thankx in advance

Lothar Haensler
January 27th, 2000, 06:00 AM
private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = len(Text1.Text)
End Sub

Chris Eastwood
January 27th, 2000, 06:01 AM
Try something like :


'
private Sub Text1_GotFocus()
GotFocus Text1
End Sub
'
private Sub Text2_GotFocus()
GotFocus Text2
End Sub
'
private Sub GotFocus(oTxt as TextBox)
on error resume next
'
oTxt.SelStart = 0
oTxt.SelLength = len(oTxt.Text)
'
End Sub






Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb