If you have a text field named txtMytext and it contains "abcdefghijklmnop" then the following code
txtMytext.Focus()
txtMytext.SelectionStart = 3
txtMytext.SelectionLength = 6
will set focus to the control with "defghi" selected.
Reverend Jim
Posting Shark
1,169 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
To do the focus and highligh all the text inside ot it:
texrBox1.Focus()
texrBox1.SelectionStart = 0
texrBox1.SelectionLength = textBox1.Text.Lenght
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474