主题:标题栏上显示年月日,能不能把它移植到窗体上?
下面这段代码可以把年月日用中文显示在标题栏上,能不能把它移植到窗体上呢?请试一试,如果成功请通知我。我的Email:ad50159635@online.sh.cn
Clear All
Close All
Set Date Ansi
Set Talk off
on Error MessageBox(Message(),0+48,"注意")
Public ClassesPath,DataPath,FormsPath,MenusPath,PicturesPath,ProgramsPath,ReportFormsPath,SystemPath,TempfilesPath
&&该语句定义若干公共变量,除了后一个外,分别对应本应用系统文件子目录路径
SystemPath=JustPath(Sys(16)) &&使用函数Sys(16)用以获得可执行文件“会计主程序.exe”所在的目录路径及文件名,
&&函数JustPath()从含有路径及文件名的字符串中截取路径部分字符串,结果用变量SystemPath保存
ClassesPath=SystemPath+"\Classes\" &&通过变量SystemPath中的路径字符串来定义各路径变量
DataPath=SystemPath+"\Data\"
FormsPath=SystemPath+"\Forms\"
MenusPath=SystemPath+"\Menus\"
PicturesPath=SystemPath+"\Pictures\"
ProgramsPath=SystemPath+"\Programs\"
ReportFormsPath=SystemPath+"\ReportForms\"
PermitLogin=.T.
Select 0 &&选择空闲且编号最小的工作区
Use DataPath+"登录许可" Shared &&以共享方式打开表
If 登录许可.登录=="F"
MessageBox("正在进行系统设置工作,请稍侯再登录。",0+48,"注意")
PermitLogin=.F.
Endif
Use In 登录许可
If PermitLogin=.F.
Quit
Else
_Screen.Caption=" [今天日期是:"+Str(Year(Date()),4)+"年"
TempMonth=Month(Date()) &&以Temp开头的自定义变量为私有(临时)变量
_Screen.Caption=_Screen.Caption+Str(TempMonth,IIF(TempMonth<10,1,2))+"月"
TempDay=Day(Date())
_Screen.Caption=_Screen.Caption+Str(TempDay,IIF(TempDay<10,1,2))+"日"
TempWeekDay=Cdow(Date())
Do Case
Case TempWeekDay="Monday"
_Screen.Caption=_Screen.Caption+" 星期一]"
Case TempWeekDay="Tuesday"
_Screen.Caption=_Screen.Caption+" 星期二]"
Case TempWeekDay="Wednesday"
_Screen.Caption=_Screen.Caption+" 星期三]"
Case TempWeekDay="Thursday"
_Screen.Caption=_Screen.Caption+" 星期四]"
Case TempWeekDay="Friday"
_Screen.Caption=_Screen.Caption+" 星期五]"
Case TempWeekDay="Saturday"
_Screen.Caption=_Screen.Caption+" 星期六]"
Case TempWeekDay="Sunday"
_Screen.Caption=_Screen.Caption+" 星期日]"
End Case
Clear All
Close All
Set Date Ansi
Set Talk off
on Error MessageBox(Message(),0+48,"注意")
Public ClassesPath,DataPath,FormsPath,MenusPath,PicturesPath,ProgramsPath,ReportFormsPath,SystemPath,TempfilesPath
&&该语句定义若干公共变量,除了后一个外,分别对应本应用系统文件子目录路径
SystemPath=JustPath(Sys(16)) &&使用函数Sys(16)用以获得可执行文件“会计主程序.exe”所在的目录路径及文件名,
&&函数JustPath()从含有路径及文件名的字符串中截取路径部分字符串,结果用变量SystemPath保存
ClassesPath=SystemPath+"\Classes\" &&通过变量SystemPath中的路径字符串来定义各路径变量
DataPath=SystemPath+"\Data\"
FormsPath=SystemPath+"\Forms\"
MenusPath=SystemPath+"\Menus\"
PicturesPath=SystemPath+"\Pictures\"
ProgramsPath=SystemPath+"\Programs\"
ReportFormsPath=SystemPath+"\ReportForms\"
PermitLogin=.T.
Select 0 &&选择空闲且编号最小的工作区
Use DataPath+"登录许可" Shared &&以共享方式打开表
If 登录许可.登录=="F"
MessageBox("正在进行系统设置工作,请稍侯再登录。",0+48,"注意")
PermitLogin=.F.
Endif
Use In 登录许可
If PermitLogin=.F.
Quit
Else
_Screen.Caption=" [今天日期是:"+Str(Year(Date()),4)+"年"
TempMonth=Month(Date()) &&以Temp开头的自定义变量为私有(临时)变量
_Screen.Caption=_Screen.Caption+Str(TempMonth,IIF(TempMonth<10,1,2))+"月"
TempDay=Day(Date())
_Screen.Caption=_Screen.Caption+Str(TempDay,IIF(TempDay<10,1,2))+"日"
TempWeekDay=Cdow(Date())
Do Case
Case TempWeekDay="Monday"
_Screen.Caption=_Screen.Caption+" 星期一]"
Case TempWeekDay="Tuesday"
_Screen.Caption=_Screen.Caption+" 星期二]"
Case TempWeekDay="Wednesday"
_Screen.Caption=_Screen.Caption+" 星期三]"
Case TempWeekDay="Thursday"
_Screen.Caption=_Screen.Caption+" 星期四]"
Case TempWeekDay="Friday"
_Screen.Caption=_Screen.Caption+" 星期五]"
Case TempWeekDay="Saturday"
_Screen.Caption=_Screen.Caption+" 星期六]"
Case TempWeekDay="Sunday"
_Screen.Caption=_Screen.Caption+" 星期日]"
End Case