Jump to content

Do you have a ready code that creates input control for typing time in HH:MM:SS format?


Recommended Posts

Do you have a ready code that creates input control for typing time in HH:MM:SS format?

(

With next functions:

-$ES_NUMBER

-automatically adding a ":"

-editing

)

If not - dont write it from a zero(its so much IF's need...)

I just wanted to ask:)

_____________________________________________________________________________

Link to comment
Share on other sites

peethebee wrote something with RegExp in 2006 :Dhttp://www.autoitscript.com/forum/index.ph...ctControlRegExp

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

[To Yashied]

I thought of it and maybe stop on 1 Input and 3 Sliders:)

(I wrote code that read data and adds automatically ":" when its need, but make it editable(after type numbers) its difficult)

_____________________________________________________________________________

Link to comment
Share on other sites

What's wrong with _GUICtrlDTP_Create() ??

Link to comment
Share on other sites

Try this.

#Include <GUIConstants.au3>
#Include <EditConstants.au3>
#Include <WindowsConstants.au3>

GUICreate("MyGUI", 300, 50)
$Input = GUICtrlCreateInput("", 15, 15, 270, 19)
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Switch BitAND($wParam, 0xFFFF)
        Case $Input
            Switch BitShift($wParam, 16)
                Case $EN_CHANGE

                    Local $Data = StringRegExpReplace(GUICtrlRead($Input), "[^0-9, :]", "")

                    ; Here you analyze your Input data
                
                    GUICtrlSetData($Input, $Data)
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_COMMAND
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...