FoxPro Programming
Date time picker
Gravatar is a globally recognized avatar based on your email address. Date time picker
  Bob
  All
  Jan 25, 2021 @ 06:37pm

Does anyone know of a Date picker control that would be compatible with VFP9 running in Windows 10?

Gravatar is a globally recognized avatar based on your email address. re: Date time picker
  Bob
  Tore Bleken
  Jan 26, 2021 @ 06:04am

This would be a really cool date picker except the the code in the click event doesn't fire correctly when placed on a form that already has a read event. The popup calendar just flashes.

LOCAL dHoldDate
Public dSelectedDate, oCalendar
*!* Code below was commented out to allow for empty dates
*!*	IF EMPTY(this.Parent.txtDate.value)
*!*		dSelectedDate = DATE()
*!*	ELSE
	dSelectedDate = this.Parent.txtDate.value
*!*	ENDIF
oCalendar = CREATEOBJECT("calCalendar", dSelectedDate)
this.Parent.PositionCalendar(oCalendar)
oCalendar.visible = .t.
BINDEVENT(thisform, "moved", this.Parent, "PositionCalendar")
READ EVENTS
UNBINDEVENTS(thisform, "moved", this.Parent, "PositionCalendar")
*!*	IF dHoldDate != dSelectedDate
	WITH this.parent
		dHoldDate = .txtDate.Value
		.txtDate.Value = dSelectedDate
		.txtDate.refresh()
		IF dHoldDate != dSelectedDate
			this.parent.interactiveChange()
		ENDIF
	ENDWITH
*!*	ENDIF
oCalendar = NULL
RELEASE dSelectedDate, oCalendar
Gravatar is a globally recognized avatar based on your email address. re: Date time picker
  Tore Bleken
  Bob
  Jan 26, 2021 @ 06:09am

Try to step through the code in the debugger. Looks like you release oCalendar too early??

© 1996-2021