Wb-FreeKill Posted May 24, 2005 Share Posted May 24, 2005 (edited) Is it possible to set an int limit on an input?.. so when useing Beep() the user would only be able to input integeres between those 37 to 32767. Possible? EDIT: and how do i make the Combo readonly? Edited May 24, 2005 by Wb-FreeKill Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2005 Share Posted May 24, 2005 (edited) before your edit.... this is how i keep the integeres.. sample code with input/checking expandcollapse popup#include <GUIConstants.au3> #include <File.au3> #include <Array.au3> #include <String.au3> $My_GUI=GUICreate("My GUI",400,200,50,50) $Button1= GUICtrlCreateButton("Note", 30,30,100,30) GUICtrlCreateLabel("This is a Music/Tone testing program", 50,140) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button1 Call("Set_num") EndSelect WEnd Func Set_num() $Num_ans = InputBox("Set Music Notes", "Please Type a number for the Tone ie..." & @CRLF & @CRLF & " From 37 to 37767 " & @CRLF & @CRLF & " 75 or 100 or ? ", "", "", "", "", -1, -1, 15) Select Case @error = 0;OK - The string returned is valid If $Num_ans > 37 And $Num_ans < 37767 Then Beep($Num_ans) Sleep(20) Else MsgBox(64, "Sorry!", " Please use numbers ONLY from " & @CRLF & @CRLF & " 37 to 37767... 45, 65, etc ") EndIf Case @error = 1;The Cancel button was pushed Case @error = 2;The Timeout time was reached Case @error = 3;The InputBox failed to open EndSelect EndFunc hope it helps Edited May 24, 2005 by Valuater Link to comment Share on other sites More sharing options...
Helge Posted May 24, 2005 Share Posted May 24, 2005 EDIT: and how do i make the Combo readonly?<{POST_SNAPBACK}>Use this style : $CBS_DROPDOWNLIST 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