Yorn Posted January 23, 2008 Share Posted January 23, 2008 (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 January 23, 2008 by Yorn Link to comment Share on other sites More sharing options...
evilertoaster Posted January 23, 2008 Share Posted January 23, 2008 What about the $ES_NOHIDESEL style for the edit control? Link to comment Share on other sites More sharing options...
Yorn Posted January 23, 2008 Author Share Posted January 23, 2008 (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 January 23, 2008 by Yorn Link to comment Share on other sites More sharing options...
ResNullius Posted January 24, 2008 Share Posted January 24, 2008 (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 January 24, 2008 by ResNullius Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now