Jump to content

Maximum and minimum in CreateInput


Recommended Posts

#include <GUIConstants.au3>
$GUI = GUICreate("GUI", 200, 50, 187, 118)
$Value = GUICtrlCreateInput("48", 16, 16, 40, 21)
GuiCtrlCreateUpDown(-1)
GUISetState(@SW_SHOW)

While 1
    Sleep (1000);Idle around
WEnd

How can I set a maximum and a minimum number in the input that I created? I want that the min will be 1, and the maximum will be 48.

Link to comment
Share on other sites

#include <GUIConstants.au3>
$GUI = GUICreate("GUI", 200, 50, 187, 118)
$Value = GUICtrlCreateInput("48", 16, 16, 40, 21)
GuiCtrlCreateUpDown(-1)
GUISetState(@SW_SHOW)

While 1
    Sleep (1000);Idle around
WEnd

How can I set a maximum and a minimum number in the input that I created? I want that the min will be 1, and the maximum will be 48.

#include <GUIConstants.au3>
$GUI = GUICreate("GUI", 200, 50, 187, 118)
$Value = GUICtrlCreateInput("48", 16, 16, 40, 21)
GuiCtrlCreateUpDown(-1)
GUISetState(@SW_SHOW)

While 1
    $Number = GUICtrlRead($Value)
    if $Number <1 Or $Number > 48 Then
        GUICtrlSetData($Value,"48")
    EndIf
    Sleep (1000);Idle around
WEnd

:)

[center]uqoii.nl[/center]

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...