Function myweekdayName(weekofday As Integer) As String
Select Case weekofday
case1
myweekdayName = "星期日"
Case2
myweekdayName = "星期一"
case3
myweekdayName = "星期二"
case4
myweekdayName = "星期三"
case5
myweekdayName = "星期四"
case6
myweekdayName = "星期五"
case7
myweekdayName = "星期六"
End Select
End Function
Private Sub Command1_Click()
Dim year As Integer
Dim month As Integer
Dim day As Integer
Dim weekofday As Byte
Dim Birthday As Date
year = Int(Val(Text1.Text))
month = Int(Val(Text2.Text))
day = Int(Val(Text3.Text))
Birthday = DateSerial(year, month, day)
weekofday = Weekday(Birthday)
Label7.Caption = WeekdayName(weekofday)
End Sub