Sign in to follow this  
Followers 0
Yorn

On click, select all text in edit control

4 posts in this topic

#1 ·  Posted (edited)

I've seen a number of controls where if you click in the edit or input box it selects all the text currently in there so that when you begin typing it will replace it. I'd like to do that same thing with an AutoIt program. I did a search for "on click select all" on the forums and it complained about the word "on" so I'm asking here. I did do a "onclick select all" and a few other searches but nothing was coming up. Wouldn't this just be an attribute that I could assign to the edit or text control?

Here's a sample of the code:

$Input4 = GUICtrlCreateInput("Type a short description of your problem here...", 188, 38, 440, 22)

$Edit3 = GUICtrlCreateEdit("Type a more detailed description of your problem here...", 187, 63, 441, 139, BitOR($WS_VSCROLL,$ES_WANTRETURN))

I'd like both of those controls to wipe current data when they are clicked on. Thanks in advance.

Edited by Yorn

Share this post


Link to post
Share on other sites



What about the $ES_NOHIDESEL style for the edit control?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

no, that doesn't do an "on click" event. Basically, if I hit tab to go between field, it selects all text by default for each edit control. If I click, however, it does NOT select all text. I want the two to be essentially the same. I've got a temporary solution in place, but anyone who has any suggestions (I appreciate your comments, eviltoaster) I'm all for it. ES_NoHideSel seems to just turn everything in the control blue as if it's all being selected (but the very second you click in the control, it clears)

Edited by Yorn

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I've seen a number of controls where if you click in the edit or input box it selects all the text currently in there so that when you begin typing it will replace it. I'd like to do that same thing with an AutoIt program. I did a search for "on click select all" on the forums and it complained about the word "on" so I'm asking here. I did do a "onclick select all" and a few other searches but nothing was coming up. Wouldn't this just be an attribute that I could assign to the edit or text control?

Here's a sample of the code:

$Input4 = GUICtrlCreateInput("Type a short description of your problem here...", 188, 38, 440, 22)

$Edit3 = GUICtrlCreateEdit("Type a more detailed description of your problem here...", 187, 63, 441, 139, BitOR($WS_VSCROLL,$ES_WANTRETURN))

I'd like both of those controls to wipe current data when they are clicked on. Thanks in advance.

I think MsCreatoR has done what you want here: _CheckInput() UDF

Works with input boxes and edit boxes.

EDIT: Actually, might want to review that whole thread as there are some changes/improvents later on, including this by GaryFrost http://www.autoitscript.com/forum/index.ph...st&p=391271

Edited by ResNullius

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0