Jump to content
Sign in to follow this  
sandin

Windows "clock"-type input box?

Recommended Posts

sandin

Hi all,

This is the input box, I'm talking about:

Posted Image

On double click, it doesn't select all, but only 2 numbers between ":" characters, how can this be done?, and how can I lock it to only numbers, but not higher than 59?

Another question, how can I lock ":" characters? Cause those characters aren't selectable, nor changeable in the input box like this one.

Thank you.

Share this post


Link to post
Share on other sites
Pain

look at the example for GUICtrlCreateDate in the helpfile.

Share this post


Link to post
Share on other sites
sandin
sandin
sandin
BrettF
sandin

tnx :P Ya, it can work, but it'll work only after user click START TIMER button, so, the user would still see hour settings, before he clicks the button, right?

If this is not possible? Is it possible to recreate similar input box? With non-selectable ":" marks, and inputting numbers not higher than 59? The only thing I'm thinking of at the moment, is making 3 different inputs with ":" label between them, but I would really love if someone could help me with the guictrlcreatedate-type input.

Thank you.

Share this post


Link to post
Share on other sites
ProgAndy

You just have to set the display-Format :P

#include <GuiDateTimePicker.au3>

    $DTPicker = (GUICtrlCreateDate("", 2, 6, 80,Default,$DTS_UPDOWN ))
    $handleDTP = GUICtrlGetHandle($DTPicker)
    ; Set the display format HH -> 24 Hour Display
    _GUICtrlDTP_SetFormat($handleDTP,"HH:mm:ss")

*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

Share this post


Link to post
Share on other sites
sandin

omg, thank you so much! This is perfect :P

...and I started making brand new input ^^

#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 150)
$Input1 = GUICtrlCreateInput("00", 20, 20, 13, 17, 0x2000, 0x00000080)
    GUICtrlSetLimit(-1, 2)
GUICtrlCreateLabel(":", 33, 20, 3, 17)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetColor(-1, 0)
$input2 = GUICtrlCreateInput("00", 36, 20, 13, 17, 0x2000, 0x00000080)
    GUICtrlSetLimit(-1, 2)
GUICtrlCreateLabel(":", 49, 20, 3, 17)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetColor(-1, 0)
$input3 = GUICtrlCreateInput("00", 52, 20, 16, 17, 0x2000, 0x00000080)
    GUICtrlSetLimit(-1, 2)
$input4 = GUICtrlCreateInput("", 70, 19, 15, 19)
$up_down = GUICtrlCreateUpdown(-1)
GUICtrlCreateGraphic(19, 19, 50, 1, 0x08)
GUICtrlCreateGraphic(19, 37, 50, 1, 0x08)
GUICtrlCreateGraphic(19, 20, 1, 17, 0x08)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.