PROCEDURE Text1.Init THIS.Value = DATE () ENDPROC PROCEDURE Text1.LostFocus LOCAL ldDate AS DATE ldDate = THIS.Value SET DATE YMD THIS.Value = DATE (YEAR (ldDate), MONTH (ldDate), DAY (ldDate)) ENDPROCHTH
>Public oform1 >oform1=createobject("form1") >oform1.Show >Return >* >DEFINE CLASS form1 AS form > > Top = 0 > Left = 0 > Height = 109 > Width = 185 > DoCreate = .T. > Caption = "Form1" > Name = "form1" > > > ADD OBJECT text2 AS textbox WITH ; > FontName = "Tahoma", ; > BackStyle = 1, ; > BorderStyle = 0, ; > Value = "/", ; > Enabled = .F., ; > Height = 21, ; > InputMask = "99", ; > Left = 79, ; > MaxLength = 2, ; > ReadOnly = .T., ; > SpecialEffect = 1, ; > TabIndex = 5, ; > Top = 12, ; > Width = 9, ; > BackColor = RGB(192,192,192), ; > DisabledForeColor = RGB(0,0,0), ; > Name = "Text2" > > > ADD OBJECT text3 AS textbox WITH ; > FontName = "Tahoma", ; > BackStyle = 1, ; > BorderStyle = 0, ; > Value = "/", ; > Enabled = .F., ; > Height = 21, ; > InputMask = "99", ; > Left = 103, ; > MaxLength = 2, ; > ReadOnly = .T., ; > SpecialEffect = 1, ; > TabIndex = 6, ; > Top = 12, ; > Width = 9, ; > BackColor = RGB(192,192,192), ; > DisabledForeColor = RGB(0,0,0), ; > Name = "Text3" > > > ADD OBJECT yeartxt AS textbox WITH ; > FontName = "Tahoma", ; > BorderStyle = 0, ; > Enabled = .T., ; > Height = 21, ; > InputMask = "9999", ; > Left = 48, ; > MaxLength = 4, ; > SelectOnEntry = .T., ; > SpecialEffect = 1, ; > TabIndex = 3, ; > Top = 12, ; > Width = 33, ; > BackColor = RGB(255,128,255), ; > Name = "YearTxt" > > > ADD OBJECT monthtxt AS textbox WITH ; > FontName = "Tahoma", ; > BorderStyle = 0, ; > Enabled = .T., ; > Height = 21, ; > InputMask = "99", ; > Left = 86, ; > MaxLength = 2, ; > SelectOnEntry = .T., ; > SpecialEffect = 1, ; > TabIndex = 2, ; > Top = 12, ; > Width = 19, ; > BackColor = RGB(255,128,255), ; > Name = "MonthTxt" > > > ADD OBJECT daytxt AS textbox WITH ; > FontName = "Tahoma", ; > BorderStyle = 0, ; > Enabled = .T., ; > Height = 21, ; > InputMask = "99", ; > Left = 110, ; > MaxLength = 2, ; > SelectOnEntry = .T., ; > SpecialEffect = 1, ; > TabIndex = 1, ; > Top = 12, ; > Width = 19, ; > BackColor = RGB(255,128,255), ; > Name = "DayTxt" > > > ADD OBJECT text1 AS textbox WITH ; > FontName = "Tahoma", ; > Alignment = 3, ; > Value = {}, ; > Enabled = .T., ; > Format = "", ; > Height = 23, ; > InputMask = "", ; > Left = 48, ; > Top = 51, ; > Width = 80, ; > Name = "Text1" > > > PROCEDURE Init > SET CENTURY ON > SET DATE YMD > ENDPROC > > > PROCEDURE text1.GotFocus > SET DATE DMY > ENDPROC > > > PROCEDURE text1.LostFocus > SET DATE YMD > ENDPROC > > >ENDDEFINE >