Select entire field automatically

DataMiner

Registered User.
Local time
Today, 03:41
Joined
Jul 26, 2001
Messages
336
Hi,
I want to have the entire field in a textbox selected, automatically, everytime the control is entered--- so the user can just begin typing and automatically type over the existing data in the textbox.

How do I do this?

I thought it would be as simple as adding something like the following to the textbox's on_enter event:

Sendkeys "doubleclick"


The textbox will always contain just a single "word", so this idea should work....but I can't find anything like a "doubleclick" that can be used with SendKeys.

THanks for any ideas.
 
Take a look at the SelLength and SelStart Properties in VBA Help.
 
Thanks, sounds like what I was looking for.
I also found that the "f2" key seems to select the whole word in the text box; can't find this actually documented anywhere, but at any rate it seems to work with sendkeys.
 

Users who are viewing this thread

Back
Top Bottom