Jump to content

Get Month from GUICtrlCreateDate


Supratik
 Share

Recommended Posts

$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:

Link to comment
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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...