Gillboss Posted September 25, 2008 Posted September 25, 2008 i want limit GUICtrlCreateInput to numbers only and value of 0-24 i try it: $Hours = GUICtrlCreateInput("", 50, 67, 20, 20, $ES_NUMBER) GUICtrlSetLimit($Hours,0,24) and its not work.. what fix?
ptrex Posted September 25, 2008 Posted September 25, 2008 @Gillboss Maybe try this. $Hours = GUICtrlCreateInput("", 50, 67, 20, 20, $ES_NUMBER) GUICtrlSetLimit($Hours,24,0) regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Gillboss Posted September 25, 2008 Author Posted September 25, 2008 @Gillboss Maybe try this. $Hours = GUICtrlCreateInput("", 50, 67, 20, 20, $ES_NUMBER) GUICtrlSetLimit($Hours,24,0)oÝ÷ Ú· j·l¦ÚÞÇú®¢×§¢Ü(®F®¶sb4æ6ÇVFRfÇC´wVVFBæS2fwC°¢6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC° ¢b33c´ÖäuTÒuT7&VFRgV÷C´Æ&Òòb33´6Æö6²gV÷C²Â3Â# ¢b33c´÷W'2ÒuT7G&Ä7&VFTçWBgV÷C²gV÷C²ÂSÂcrÂ#Â#Âb33c´U5ôåTÔ$U"¤uT7G&Å6WDÆÖBb33c´÷W'2Ã#Bà ¤uT6WE7FFR ¥vÆR¢b33c¶Ô×6rÒuTvWD×6r¢6VÆV7@¢66Rb33c¶Ô×6rÒb33c´uTôUdTåEô4Äõ4P¢W@¢VæE6VÆV7@¥tVæ
Andreik Posted September 25, 2008 Posted September 25, 2008 (edited) GuiCtrlSetLimit For Input/Edit controls it is the max number of characters that can be entered. You can use something like this: #Include <GuiEdit.au3> #include <GUIConstants.au3> $MainGUI = GUICreate("Alarm O'Clock", 300, 210) $Hours = GUICtrlCreateInput("", 50, 67, 40, 20, $ES_NUMBER) $limit = GUICtrlCreateUpdown($Hours) GUICtrlSetLimit($limit,24,0) GUISetState() While 1 $mMsg = GUIGetMsg() Select Case $mMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Edited September 25, 2008 by Andreik
martin Posted September 25, 2008 Posted September 25, 2008 (edited) i want limit GUICtrlCreateInput to numbers only and value of 0-24 i try it: $Hours = GUICtrlCreateInput("", 50, 67, 20, 20, $ES_NUMBER) GUICtrlSetLimit($Hours,0,24) and its not work.. what fix? expandcollapse popup#include <GuiConstantsEx.au3> #include <editconstants.au3> #include <windowsconstants.au3> $MainGui = GUICreate('test', 300, 150) $Input1 = GUICtrlCreateInput("", 50, 10, 150) $ip1 = GUICtrlRead($Input1) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND");only used for EN_CHANGE so far While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WM_COMMAND($hWnd, $imsg, $iwParam, $ilParam) Local $AtPos, $s1 $nNotifyCode = BitShift($iwParam, 16) $nID = BitAND($iwParam, 0x0000FFFF) $hCtrl = $ilParam If $nNotifyCode = $EN_CHANGE Then If $ilParam = GUICtrlGetHandle($Input1) Then $s1 = GUICtrlRead($Input1) If $s1 = '-' Then $s1 = '' If $s1 > 24 Or $s1 < 0 Then GUICtrlSetData($Input1, $ip1) Else $ip1 = $s1 EndIf EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Edited September 25, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Gillboss Posted September 25, 2008 Author Posted September 25, 2008 GuiCtrlSetLimit For Input/Edit controls it is the max number of characters that can be entered. You can use something like this: #Include <GuiEdit.au3> #include <GUIConstants.au3> $MainGUI = GUICreate("Alarm O'Clock", 300, 210) $Hours = GUICtrlCreateInput("", 50, 67, 40, 20, $ES_NUMBER) $limit = GUICtrlCreateUpdown($Hours) GUICtrlSetLimit($limit,24,0) GUISetState() While 1 $mMsg = GUIGetMsg() Select Case $mMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd thx, but user can insert himself number 56 for example, and its not good.
Gillboss Posted September 25, 2008 Author Posted September 25, 2008 expandcollapse popup#include <GuiConstantsEx.au3> #include <editconstants.au3> #include <windowsconstants.au3> $MainGui = GUICreate('test', 300, 150) $Input1 = GUICtrlCreateInput("", 50, 10, 150) $ip1 = GUICtrlRead($Input1) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND");only used for EN_CHANGE so far While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WM_COMMAND($hWnd, $imsg, $iwParam, $ilParam) Local $AtPos, $s1 $nNotifyCode = BitShift($iwParam, 16) $nID = BitAND($iwParam, 0x0000FFFF) $hCtrl = $ilParam If $nNotifyCode = $EN_CHANGE Then If $ilParam = GUICtrlGetHandle($Input1) Then $s1 = GUICtrlRead($Input1) If $s1 = '-' Then $s1 = '' If $s1 > 24 Or $s1 < 0 Then GUICtrlSetData($Input1, $ip1) Else $ip1 = $s1 EndIf EndIf EndIf Return $GUI_RUNDEFMSG EndFunc;==>WM_COMMAND goooooooooooooooooooooood thx =] cool.. just add $ES_NUMBER and its perfect =]
Andreik Posted September 25, 2008 Posted September 25, 2008 thx, but user can insert himself number 56 for example, and its not good.#Include <GuiEdit.au3> #include <GUIConstants.au3> $MainGUI = GUICreate("Alarm O'Clock", 300, 210) $Hours = GUICtrlCreateInput("", 50, 67, 40, 20,BitOR($ES_NUMBER,$ES_READONLY)) $limit = GUICtrlCreateUpdown($Hours) GUICtrlSetLimit($limit,24,0) GUISetState() While 1 $mMsg = GUIGetMsg() Select Case $mMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Now, I think is work fine.
Gillboss Posted September 25, 2008 Author Posted September 25, 2008 #Include <GuiEdit.au3> #include <GUIConstants.au3> $MainGUI = GUICreate("Alarm O'Clock", 300, 210) $Hours = GUICtrlCreateInput("", 50, 67, 40, 20,BitOR($ES_NUMBER,$ES_READONLY)) $limit = GUICtrlCreateUpdown($Hours) GUICtrlSetLimit($limit,24,0) GUISetState() While 1 $mMsg = GUIGetMsg() Select Case $mMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Now, I think is work fine. yes not its thx i think i use it =]
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