doestergaard Posted November 21, 2014 Share Posted November 21, 2014 (edited) Hi 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) GUISetState() ControlFocus("", "", $inputName) How can I achieve this with GUICtrlSetLimit without the whole text getting highligted? Thanks in advance Edited November 21, 2014 by doestergaard Link to comment Share on other sites More sharing options...
funkey Posted November 21, 2014 Share Posted November 21, 2014 You can use _GUICtrlEdit_SetSel with providing 'start' and 'end' the same value. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
doestergaard Posted November 23, 2014 Author Share Posted November 23, 2014 You can use _GUICtrlEdit_SetSel with providing 'start' and 'end' the same value. Thanks! Actually, this worked too: ControlClick($myForm, "", $inputName, "", 1, 1) 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