Jump to content

Date picker is not expanding the value


ur
 Share

Recommended Posts

I am trying to fetch date value from a form.

But, it is returning the value as 0 instead of date.

 

My code:

;----------------------------------------------------------------------------------------------------------------------------------------
;Script Name:           Input Combo Box
;Script Version:        1.0
;Purpose:               To create a custom input combo box
;Usage: inputComboBox   First argument is the first and default value in the combobox and second argument is the "|" separated other values.
;   inputComboBoxArray  Array of values loaded to the combobox and first value is the default.
;Inputs:                2 Arguments(First combobox value,remaining values)  1 Argument(Array of combobox values)
;Outputs:               Selected value in the combobox
;Dependencies:          None
;Author:                Uday Kiran Reddy
;Date:                  4th May 2016
;----------------------------------------------------------------------------------------------------------------------------------------

;----------------------------------------------------------------------------------------------------------------------------------------
;Add libraries that we use functions/constants from
;----------------------------------------------------------------------------------------------------------------------------------------

#Include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <GuiListView.au3>
#include <GuiComboBox.au3>
#include <GuiEdit.au3>

#include <ButtonConstants.au3>
#include <GuiDateTimePicker.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

MsgBox (0,"",inputLicenseBox()[1])



Func inputLicenseBox()

Local $Form1 = GUICreate("License Applicator", 272, 121, 192, 124)
GUISetIcon("D:\erwin-installshield\SplashScreens\erwin_favicon_081706\erwin_favicon_32x32.ico", -1)
Local $Label1 = GUICtrlCreateLabel("LicenseCode", 16, 8, 66, 17)
Local $Label2 = GUICtrlCreateLabel("Expiry Date", 16, 40, 58, 17)
Local $Input1 = GUICtrlCreateInput("Input1", 88, 8, 161, 21)
;$Input2 = GUICtrlCreateInput("Input2", 88, 40, 161, 21)
Local $Input2 = _GUICtrlDTP_Create($Form1, 88, 40, 161, 21)
_GUICtrlDTP_SetFormat($Input2, "dd:MM:yyyy")
Local $idSubmitBotton = GUICtrlCreateButton("Generate", 64, 72, 129, 25)
GUISetState(@SW_SHOW)


While 1
$aMsg = GUIGetMsg(1)
    Select
            Case $aMsg[0] = $GUI_EVENT_CLOSE ; $GUI_EVENT_CLOSE is for close event occured.0 is for Event or Contrl ID.
                GUISwitch($Form1)
                GUIDelete()
                ExitLoop
            Case $aMsg[0] = $idSubmitBotton
                Local $returnValue[2] = [GUICtrlRead($Input1) , GUICtrlRead($Input2)]
                GUISwitch($Form1)
                GUIDelete()
                return $returnValue
    EndSelect
WEnd

EndFunc

 

 

Link to comment
Share on other sites

It is because you are using UDF date picker and not native date control.  You cannot read the date like you did.  See example of _GUICtrlDTP_Create in help file to understand how you can extract the date from it.

Link to comment
Share on other sites

  • Moderators

ur,

Dog eaten your help file? Look under GUICtrlCreateDate.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

ur,

The first example on that page reads the complete date - what more do you need?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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