txty的lostfocus事件:
if betw(this.value,1800,9999)
my=this.value
mm=this.parent.txtm.value
md=this.parent.txtd.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.parent.txtd.value=md
mdate=date(my,mm,md)
endd
else
this.value=year(mdate)
endi
spmode=1
thisform.spymd.KEYBOARDHIGHVALUE=9999
thisform.spymd.KEYBOARDLOWVALUE=1800
thisform.spymd.SPINNERHIGHVALUE=9999
thisform.spymd.SPINNERLOWVALUE=1800
thisform.spymd.VALUE=year(mdate)
txtm的lostfocus事件:
if betw(this.value,1,12)
my=this.parent.txty.value
mm=this.value
md=this.parent.txtd.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.parent.txtd.value=md
mdate=date(my,mm,md)
endd
else
this.value=month(mdate)
endi
spmode=2
thisform.spymd.KEYBOARDHIGHVALUE=12
thisform.spymd.KEYBOARDLOWVALUE=1
thisform.spymd.SPINNERHIGHVALUE=12
thisform.spymd.SPINNERLOWVALUE=1
thisform.spymd.VALUE=month(mdate)
txtd的lostfocus事件:
if betw(this.value,1,31)
my=this.parent.txty.value
mm=this.parent.txtm.value
md=this.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.value=md
mdate=date(my,mm,md)
endd
else
this.value=day(mdate)
endi
i=31
do while empt(date(my,mm,i))
i=i-1
endd
spmode=3
thisform.spymd.KEYBOARDHIGHVALUE=i
thisform.spymd.KEYBOARDLOWVALUE=1
thisform.spymd.SPINNERHIGHVALUE=i
thisform.spymd.SPINNERLOWVALUE=1
thisform.spymd.VALUE=day(mdate)
spymd的interactivechange事件:
do case
case spmode=1
this.parent.txty.value=this.value
this.parent.txty.setfocus
case spmode=2
this.parent.txtm.value=this.value
this.parent.txtm.setfocus
case spmode=3
this.parent.txtd.value=this.value
this.parent.txtd.setfocus
endc
my=this.parent.txty.value
mm=this.parent.txtm.value
md=this.parent.txtd.value
do while empt(date(my,mm,md))
md=md-1
this.parent.txtd.value=md
endd
spmode=0
txty的lostfocus事件:
if betw(this.value,1800,9999)
my=this.value
mm=this.parent.txtm.value
md=this.parent.txtd.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.parent.txtd.value=md
mdate=date(my,mm,md)
endd
else
this.value=year(mdate)
endi
txtm的lostfocus事件:
if betw(this.value,1,12)
my=this.parent.txty.value
mm=this.value
md=this.parent.txtd.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.parent.txtd.value=md
mdate=date(my,mm,md)
endd
else
this.value=month(mdate)
endi
txtd的gotfocus事件:
spmode=3
for i=28 to 31
my=year(mdate)
mm=month(date)
if month(date(my,mm,i+1))#mm
exit
endi
endf
thisform.spymd.KEYBOARDHIGHVALUE=i
thisform.spymd.KEYBOARDLOWVALUE=1
thisform.spymd.SPINNERHIGHVALUE=i
thisform.spymd.SPINNERLOWVALUE=1
thisform.spymd.VALUE=day(mdate)
txtd的lostfocus事件:
if betw(this.value,1,31)
my=this.parent.txty.value
mm=this.parent.txtm.value
md=this.value
mdate=date(my,mm,md)
do while empt(mdate)
md=md-1
this.value=md
mdate=date(my,mm,md)
endd
else
this.value=day(mdate)
endi
spymd的interactivechange事件:
do case
case spmode=1
this.parent.txty.value=this.value
this.parent.txty.setfocus
case spmode=2
this.parent.txtm.value=this.value
this.parent.txtm.setfocus
case spmode=3
this.parent.txtd.value=this.value
this.parent.txtd.setfocus
endc
spmode=0
我在text1的click中的代码是:
do case
case this.selstart=>1.and.this.selstart<=4
thisform.spinner1.value=year(date())
case this.selstart=>5.and.this.selstart<=6
thisform.spinner1.value=month(date())
case this.selstart=>9.and.this.selstart<=10
thisform.spinner1.value=day(date())
endcase
在text1的init中的代码是:this.value=allt(str(year(date())))+'.'+allt(str(month(date())))+'.'+allt(str(day(date())))
在spinner1的downclick的代码是:
do case
case thisform.text1.selstart=>0..and.thisform.text1.selstart<=4
this.spinnerlowvalue=1990
thisform.text1.value=allt(str(this.value))+allt(subs((thisform.text1.value),5,6))
thisform.text1.selstart=0
case thisform.text1.selstart=>6..and.thisform.text1.selstart<=7
this.spinnerlowvalue=1
if this.value<10
thisform.text1.value=allt(subs((thisform.text1.value),1,5))+'0'+allt(str (this.value)+subs((thisform.text1.value),8,3))
else
thisform.text1.value=allt(subs((thisform.text1.value),1,5))+allt(str(this.value)+subs((thisform.text1.value),8,3))
endif
thisform.text1.selstart=6
case thisform.text1.selstart=>9..and.thisform.text1.selstart<=10
this.spinnerlowvalue=1
if this.value<10
thisform.text1.value=allt(subs((thisform.text1.value),1,8))+'0'+allt(str(this.value))
else
thisform.text1.value=allt(subs((thisform.text1.value),1,8))+allt(str(this.value))
endif
thisform.text1.selstart=9
endcase
在spinner1的upclick中的代码是:
do case
case thisform.text1.selstart=>0..and.thisform.text1.selstart<=4
this.spinnerhighvalue=2050
this.spinnerlowvalue=2000
thisform.text1.value=allt(str(this.value))+allt(subs((thisform.text1.value),5,6))
thisform.text1.selstart=0
case thisform.text1.selstart=>6..and.thisform.text1.selstart<=7
this.spinnerhighvalue=12
if this.value<10
thisform.text1.value=allt(subs((thisform.text1.value),1,5))+'0'+allt(str(this.value)+subs((thisform.text1.value),8,3))
else
thisform.text1.value=allt(subs((thisform.text1.value),1,5))+allt(str(this.value)+subs((thisform.text1.value),8,3))
endif
thisform.text1.selstart=6
case thisform.text1.selstart=>9..and.thisform.text1.selstart<=10
this.spinnerhighvalue=31
if this.value<10
thisform.text1.value=allt(subs((thisform.text1.value),1,8))+'0'+allt(str(this.value))
else
thisform.text1.value=allt(subs((thisform.text1.value),1,8))+allt(str(this.value))
endif
thisform.text1.selstart=9