Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default DS, Set century off and a textbox
Message
From
17/02/2005 18:32:13
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00988148
Message ID:
00988159
Views:
37
Nadya-

>I found another weird thing today. I created a test form in default DS. I put textbox on a form and set its controlsource to date field. I put set century off in the form's Load. But the textbox still displayed the date with 4 digits year (and same with datetime textbox). I put century off for the textbox itself and it still showed the date with 4 digits for the year.

As for the latter, I don't see the problem given the following code using the native classes. BTW, it would really be nice if you'd start with a runnable example, Nadya, since you're not a newbie any longer.
Public oform1

oform1=Newobject("form1")
oform1.Show
Return


**************************************************
*-- Form:         form1 (f:\temp\temp.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   02/17/05 03:17:14 PM
*
Define Class form1 As Form


  DoCreate = .T.
  Caption = "Form1"
  Name = "Form1"


  Add Object text1 As TextBox With ;
    Alignment = 3, ;
    Value = (Date()), ;
    ControlSource = "temp.d1", ;
    Height = 23, ;
    Left = 136, ;
    Top = 49, ;
    Width = 100, ;
    Name = "Text1"


  Add Object check1 As Checkbox With ;
    Top = 52, ;
    Left = 249, ;
    Height = 17, ;
    Width = 79, ;
    Caption = "Century On", ;
    Name = "Check1"


  Procedure Load
  Set Century Off
  Create Cursor temp (d1 d)
  Insert Into temp Values (Date())
  Endproc


  Procedure check1.Click
  If This.Value
    This.Parent.text1.Century = 1
  Else
    This.Parent.text1.Century = 2
  Endif
  Endproc


  Procedure check1.Init
  This.Value = This.Parent.text1.Century = 1
  Endproc


Enddefine
*
*-- EndDefine: form1
**************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform