Jump to content
Sign in to follow this  

How to set text cursor at the beginning of an Input control?

Recommended Posts


Im currently struggling with setting the position of the text cursor to the beginning of an input control. The input control needs to be limited to only 15 characters, but when I apply that, the control focus function will instead highlight the text, rather then place the cursor at the beginning of the input.

If i apply the data directly to the input without the GUICtrlSetLimit, the cursor will be at the beginning of my input control when it gets focused, like so:

Global $inputName = GUICtrlCreateInput($regName, 110, 92, 362, 22)
GUICtrlSetFont($inputName, 10, 0, "", "", $DRAFT_QUALITY)
GUICtrlSetStyle($inputName, $ES_UPPERCASE)
ControlFocus("", "", $inputName)

How can I achieve this with GUICtrlSetLimit without the whole text getting highligted?


Thanks in advance

Edited by doestergaard

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  

  • Create New...