日期:2009-06-22  浏览次数:20809 次

A VBS CLASS calendar
calendar.vbs
<%
'*************************************************************************************************

'VBScript 日历 组件
'
'赋值:
'    Mnth            日历月份
'    Yr            日历年份
'    FontSize        字体大小
'    Columns            月份显示列数
'    FontFace        字体样式    
'    FontColour        字体颜色
'    FillColour        星期背景颜色
'    BorderColour        边框颜色
'    BackgroundColour    日历背景颜色
'    FullYearLink        全年月份连接
'
'取值:
'    MonthCal        月份表格
'    YearCal            年份表格
'方法:
'    LoadMonthArray        私有方法
'*************************************************************************************************
%>
<Script LANGUAGE=JavaScript>
//定义整个年份查看连接函数
function showyearcal(link, year) {
if (link.indexOf('?') > 0)
    link = link + '&year=' + year
else
    link = link + '?year=' + year
calwin=window.open( link, 'calwin', 'toolbar=yes, scrollbars=yes, status=yes, width=680, height=480' )
if (typeof(calwin.focus) != "undefined") {
    calwin.focus()
    }
}
//定义月份查看连接函数
function changemonth(moveby) {
document.calform.calmonth.value = document.calform.calmonth.value - 0 + moveby;
document.calform.submit();
}
function changeyear(moveby) {
document.calform.calyear.value = document.calform.calyear.value - 0 + moveby;
document.calform.submit();
}
</script>
<style>
td.day {font-family:arial;font-size:8pt;color:black}
</style>
<%
'定义日历类

class calendar

    private M, Y, D, WeekNo, MonthArray, FSize, FFace, FColour, BorderCol, FillCol, BGCol, BigCol, SingleMonth, FYLink, Cols, cStyleSheet
    '声明私有变量

    property let Mnth(Month)  
        if Month >= 1 and Month <= 12 then
            M = Month
        end if
    end property
    '给月份赋值

    property let Yr(Year)    
        if Year > 1 and Year < 9999 then
            Y = Int(Year)
        end if
    end property
    '给年份赋值
    
    property l