ur Posted November 20, 2020 Share Posted November 20, 2020 I am trying to fetch date value from a form. But, it is returning the value as 0 instead of date. My code: expandcollapse popup;---------------------------------------------------------------------------------------------------------------------------------------- ;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 More sharing options...
Nine Posted November 20, 2020 Share Posted November 20, 2020 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. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
ur Posted November 22, 2020 Author Share Posted November 22, 2020 Any sample code for native date control? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 22, 2020 Moderators Share Posted November 22, 2020 ur, Dog eaten your help file? Look under GUICtrlCreateDate. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ur Posted November 23, 2020 Author Share Posted November 23, 2020 Yeah, dog ate it, that's why there is some code missing to get the value completely. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 23, 2020 Moderators Share Posted November 23, 2020 ur, The first example on that page reads the complete date - what more do you need? M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nine Posted November 23, 2020 Share Posted November 23, 2020 2 hours ago, ur said: Yeah, dog ate it, that's why there is some code missing to get the value completely. Check dog's poo. You will find the example code there ! Melba23 and jchd 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
GokAy Posted November 23, 2020 Share Posted November 23, 2020 Got some Labrador in it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now