Sign in to follow this  
Followers 0
Vladi243

Maximum and minimum in CreateInput

4 posts in this topic

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Vladi243

Use GUICtrlSetLimit() function.

Share this post


Link to post
Share on other sites

Thanks,

The both options working great.

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