Textbox.SetFocus

W

Warrio

Hello!
Is it possible on a form to set the focus on a field without having the hole
filed selected?

cause if I use:

Textbox.SetFocus

, the hole text that contains the textbox is selected!
how can I give the focus to this textbox without having the text select, but
have the cursor at the end of the text?

Thanks for any suggestion
 
M

misha

use the SelStart and SelLength to control the selection:

Textbox.SetFocus
Textbox.SelStart = 0 'places the cursor
Textbox.SelLength = 0 'sets the selection length

hope this helps
 
W

Warrio

EXCELLENT!!!!!!!!!!!!!!!!

merci!!

misha said:
use the SelStart and SelLength to control the selection:

Textbox.SetFocus
Textbox.SelStart = 0 'places the cursor
Textbox.SelLength = 0 'sets the selection length

hope this helps
 
Top