Sign in to follow this  
Followers 0
Country73

GuiCtrlCreateInput ?

6 posts in this topic

#1 ·  Posted (edited)

Created a small GUI that has two input fields, for numeric input, created using GuiCtrlCreateInput + $ES_NUMBER.

Set the size limit using GuiCtrlSetLimit

Focused on the first input field by using $GUI_FOCUS

Question:

Once the first input field has reached it's limit, is there a control to automatically focus on the second input field?

Example:

Two input fields used to enter a specific time. First input = HOUR, Second input = MINUTE

If you wanted to use 1130, then once you enter 11 in first input field I want the focus to automatically switch to second input field for 30.

Any suggestions/assistance?

Thanks,

(This is for a manual entry by the end user)

Edited by Country73

If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites



could you do a character count on the input then use an if character count = # then statement? I can't think of the character count command off the top of my head though.


Giggity

Share this post


Link to post
Share on other sites

Is it the: _GUICtrlEdit_LineLength ?

I'm trying that out now.


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites

If that doesn't work then just do:

StringLen(GUICtrlRead($input))


Regards,Josh

Share this post


Link to post
Share on other sites

Thanks JFee, thats the one I was thinking of.


Giggity

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Boy, I need to stop looking for the difficult way in doing these things!

Thank you JFee & youknowwho4eva

Was able to work it out with this type of setup (In case anyone is interested):

Function called as soon as the GUI is launched.

First call to the function sends "HOUR"

Second call to the function sends "MIN"

Func runloop( $time )

   IF $time = "HOUR" Then
      $vTime = $SD_Hour            ;$SD_Hour is the first input field for the HOUR
      $nextStep = $SD_Min          ;$SD_Min is the second input field for MINUTE
   ElseIf $time = "MIN" Then
      $vTime = $SD_Min
      $nextStep = $CTSet            ;$CTSet is the SET button in the ChangeTime GUI
   EndIf

   DO
      $timeVar = StringLen( GUICtrlRead( $vTime ) )
   Until $timeVar = 2

   GUICtrlSetState( $nextStep, $GUI_FOCUS )

EndFunc

:P

Edited by Country73

If you try to fail and succeed which have you done?AutoIt Forum Search

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