Sign in to follow this  
Followers 0
Supratik

Get Month from GUICtrlCreateDate

5 posts in this topic

how i can get the month part from GUICtrlCreateDate???

actualy i want to show the month in a msgbox, when a user selects a date.

Share this post


Link to post
Share on other sites



Look here:

Might be helpful for you.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

$bdate=GUICtrlCreateDate("", -480, -550, 200, 20)

$hDTP = GUICtrlGetHandle($bdate)

_GUICtrlDTP_SetFormat($hDTP, "dddddddd ; dd,MMMMMMMMM yyyy")

;i have changed the format of default view of GUICtrlCreateDate in "Day name"; "day number of the month","Month name","year"

$aDate = StringRegExp(GUICtrlRead($bdate), "(\d+)", 3)

; now $adate[0]=day number of the month,$adate[1]=year & $adate[2] has no existence.

please help.... :unsure:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i have done it!!! :>;)

$adate=StringRegExp(GUICtrlRead($bdate), "(\D+)", 3)

msgbox(0,"",$adate[1])

thanks Mr. UEZ

:unsure:

Edited by Supratik

Share this post


Link to post
Share on other sites

Try these examples:

#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>

Global $date, $msg

GUICreate("My GUI get date", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1914/07/28", 10, 10, 185, 20, $DTS_SHORTDATEFORMAT)
GUISetState()

Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
_GUICtrlDTP_SetFormat(GUICtrlGetHandle($date), "MMMM")
$month = GUICtrlRead($date)
GUIDelete()

MsgBox(0, "Information", "Current month is: " & $month)


GUICreate("My GUI get date", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1939/09/01", 10, 10, 185, 20, $DTS_SHORTDATEFORMAT)
_GUICtrlDTP_SetFormat(GUICtrlGetHandle($date), "dd MMMM yyy")
GUISetState()
Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
$month = StringRegExpReplace(GUICtrlRead($date), "\d+", "$1")
GUIDelete()
MsgBox(0, "Information", "Current month is: " & $month)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  
Followers 0