DW1 Posted October 5, 2007 Share Posted October 5, 2007 Using the Date style $DTS_SHOWNONE, makes a little checkbox next to the date. $DueDate = GUICtrlCreateDate("", 520, 54, 95, 17, $DTS_SHOWNONE) How can I tell if this is checked or not. I can see it, but on a GuiCtrlRead I only see the date, doesn't matter if its checked or not. I need to be able to know if this was checked or not. Thank you in advance. ---Side note--- Sorry I haven't been helping/posting in a while, I just finished training for my new position AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Zedna Posted October 5, 2007 Share Posted October 5, 2007 (edited) Auto3Library is answer. In Auto3Library's _DTP_GetSystemTimeEx($hWnd) returns this flag in @error and @extended _DTP_GetSystemTimeEx($hWnd) if @error = $GDT_NONE Then ... #include <GUIConstants.au3> #include <A3LDateTimePick.au3> GUICreate("My GUI get date", 200, 200) $Datum = GUICtrlCreateDate("", 1, "test", 190, 20, BitOR($DTS_SHORTDATEFORMAT, $DTS_SHOWNONE)) $Datum_hwnd = GUICtrlGetHandle($Datum) $b = GUICtrlCreateButton('Check', 10, 50, 100, 20) GUISetState() Do $msg = GUIGetMsg() If $msg = $b Then _DTP_GetSystemTimeEx($Datum_hwnd) If @error = $GDT_NONE Then $state = 'unchecked' Else $state = 'checked' EndIf MsgBox(0, GUICtrlRead($Datum, 1), $state) ;~ MsgBox(0, GUICtrlRead($Datum, 1), GUICtrlGetState($Datum) & @CRLF) EndIf Until $msg = $GUI_EVENT_CLOSE Edited October 5, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
GaryFrost Posted October 5, 2007 Share Posted October 5, 2007 From MSDNDTS_SHOWNONE It is possible to have no date currently selected in the control. With this style, the control displays a check box that is automatically selected whenever a date is picked or entered. If the check box is subsequently deselected, the application cannot retrieve the date from the control because, in essence, the control has no date. The state of the check box can be set with the DTM_SETSYSTEMTIME message or queried with the DTM_GETSYSTEMTIME message.So in the beta help_GUICtrlDTP_GetSystemTimeor _GUICtrlDTP_GetSystemTimeEx SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 5, 2007 Share Posted October 5, 2007 Auto3Library is answer. In Auto3Library's _DTP_GetSystemTimeEx($hWnd) returns this flag in @error and @extended _DTP_GetSystemTimeEx($hWnd) if @error = $GDT_NONE Then ... #include <GUIConstants.au3> #include <A3LDateTimePick.au3> GUICreate("My GUI get date", 200, 200) $Datum = GUICtrlCreateDate("", 1, "test", 190, 20, BitOR($DTS_SHORTDATEFORMAT, $DTS_SHOWNONE)) $Datum_hwnd = GUICtrlGetHandle($Datum) $b = GUICtrlCreateButton('Check', 10, 50, 100, 20) GUISetState() Do $msg = GUIGetMsg() If $msg = $b Then _DTP_GetSystemTimeEx($Datum_hwnd) If @error = $GDT_NONE Then $state = 'unchecked' Else $state = 'checked' EndIf MsgBox(0, GUICtrlRead($Datum, 1), $state) ;~ MsgBox(0, GUICtrlRead($Datum, 1), GUICtrlGetState($Datum) & @CRLF) ;~ GUICtrlSetState($Datum, $gui_disable) EndIf Until $msg = $GUI_EVENT_CLOSE No need for external library install for many of these functions Zedna, beta now has most of them SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Zedna Posted October 5, 2007 Share Posted October 5, 2007 No need for external library install for many of these functions Zedna, beta now has most of themI know Gary but I didn't switched yet Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted September 27, 2008 Share Posted September 27, 2008 (edited) If I have it checked or not it always it returns as "checked". (I simply replaced Zedna's example with Gary's suggestion) #include <GUIConstants.au3> #Include <GuiDateTimePicker.au3> GUICreate("My GUI get date", 200, 200) $Datum = GUICtrlCreateDate("", 1, "test", 190, 20, BitOR($DTS_SHORTDATEFORMAT, $DTS_SHOWNONE)) $Datum_hwnd = GUICtrlGetHandle($Datum) $b = GUICtrlCreateButton('Check', 10, 50, 100, 20) GUISetState() Do $msg = GUIGetMsg() If $msg = $b Then _GUICtrlDTP_GetSystemTime($Datum_hwnd) If @error = $GDT_NONE Then $state = 'unchecked' Else $state = 'checked' EndIf MsgBox(0, GUICtrlRead($Datum, 1), $state) EndIf Until $msg = $GUI_EVENT_CLOSE Edited September 27, 2008 by mrRevoked Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted September 27, 2008 Share Posted September 27, 2008 (edited) Ok.. _GUICtrlDTP_GetSystemTime doesn't work, and _GUICtrlDTP_GetSystemTimeEx does. (I didn't pay attention to the example) #include <GUIConstants.au3> #Include <GuiDateTimePicker.au3> GUICreate("My GUI get date", 200, 200) $Datum = GUICtrlCreateDate("", 1, "test", 190, 20, BitOR($DTS_SHORTDATEFORMAT, $DTS_SHOWNONE)) $Datum_hwnd = GUICtrlGetHandle($Datum) $b = GUICtrlCreateButton('Check', 10, 50, 100, 20) GUISetState() Do $msg = GUIGetMsg() If $msg = $b Then _GUICtrlDTP_GetSystemTimeEx($Datum_hwnd ) If @error = $GDT_NONE Then $state = 'unchecked' Else $state = 'checked' EndIf MsgBox(0, GUICtrlRead($Datum, 1), $state) EndIf Until $msg = $GUI_EVENT_CLOSE Edited September 27, 2008 by mrRevoked Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() 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