Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DateTimePicker unable to select and modify a specific field
#6
all in one 
Function Function61
 
Code:
Copy      Help
def DTM_SETSYSTEMTIME 0x00001002

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 SysDateTimePick32 0x56030009 0x0 28 28 96 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret

#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DateTime dt.FromComputerTime; dt.AddParts(1); dt.AddMonths(1)
,SYSTEMTIME st=dt.ToSYSTEMTIME
,SendMessage(id(3 hDlg) DTM_SETFORMAT 0 "yy'-'MM'-'dd' 'HH':'mm")
,SendMessage(id(3 hDlg) DTM_SETSYSTEMTIME GDT_VALID &st)
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case DTN_DATETIMECHANGE
,NMDATETIMECHANGE* p=+nh
,if p.dwFlags=GDT_VALID
,,DateTime dt1
,,dt1.FromSYSTEMTIME(p.st)
,,out dt1.ToStrFormat("{yy-MM-dd} {HH:mm}")
,else out "empty"

can also use the arrow keys (up +down) to change values Use arrow keys(left +right) to move to each part.


Messages In This Thread
RE: DateTimePicker unable to select and modify a specific field - by Kevin - 09-25-2023, 03:02 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)