Jump to content
Sign in to follow this  
Gogi02

Date picker

Recommended Posts

Gogi02

First of all sorry for my not so perfect english. What I'd like to do is program a date picker where user is presented with a box where he can enter numbers and function automatically converts it to date format. For example user would enter 01072010 and program would convert it to date format like 01.07.2010. Unfortunately I have no Idea how to do it. Could someone please point me in the right direction?

Share this post


Link to post
Share on other sites
Mat

We've got better than that... Built in :mellow: (sort of)

#include <GuiDateTimePicker.au3>

; Create GUI
Local $hGUI = GUICreate("DateTimePick", 400, 300)
Local $hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190)
GUISetState()

; Set the display format
_GUICtrlDTP_SetFormat($hDTP, "dd:MM:yyyy")

; Loop until user exits
While GUIGetMsg() <> -3
    Sleep(10)
WEnd

Edit: changed format to what OP wanted

Edited by Mat

Share this post


Link to post
Share on other sites
Gogi02

Yeah I know about that. But I'd like to modify that so that when you enter day it would automatically jump to months and then years without the need to press an arrow key.

Share this post


Link to post
Share on other sites
Mat

You might need to process the $DTN_USERSTRING notification... I'll have a look at it for you as I'm surprised it doesn't do it by default...

Share this post


Link to post
Share on other sites
Gogi02

On the other note. How do I get data from picker box. What I mean is how do I get the date picked in a variable so I can work with it?

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.