Sign in to follow this  
Followers 0
Lemures

Highlight text upon focus

3 posts in this topic

Maybe I'm missing something completely obvious, but I have a GUI with several Input boxes that you can tab between. I would like it so that when the user tabs to the input box, the text already in the box is automatically highlighted. How do I do this?

Share this post


Link to post
Share on other sites



Maybe I'm missing something completely obvious, but I have a GUI with several Input boxes that you can tab between. I would like it so that when the user tabs to the input box, the text already in the box is automatically highlighted. How do I do this?

You must be doing something wrong. This works just fine:

#include <GUIConstants.au3>

GUICreate("Test", 400, 300)
GUICtrlCreateEdit("Edit 1", 2,  2, 190, 20, 0)
GUICtrlCreateEdit("Edit 2", 2, 22, 190, 20, 0)
GUISetState()

do
until GUIGetMsg() = $GUI_EVENT_CLOSE

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

You must be doing something wrong. This works just fine:

#include <GUIConstants.au3>

GUICreate("Test", 400, 300)
GUICtrlCreateEdit("Edit 1", 2,  2, 190, 20, 0)
GUICtrlCreateEdit("Edit 2", 2, 22, 190, 20, 0)
GUISetState()

do
until GUIGetMsg() = $GUI_EVENT_CLOSE
Oh, oops, lol. Man I am stupid. I was setting some values AFTER the thing got focus... time to rewrite a bit. Thanks!

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