Jump to content

GuiCtrlCreateInput ?


 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...