VB作业

来源:互联网 发布:阿里云系统怎么升级 编辑:程序博客网 时间:2024/05/16 07:36

Private Sub Command1_Click()

 

Dim year As Integer

Dim month As Integer

Dim day As Integer

Dim birthday As Date

Dim date of week As Byte

Year = Int (Val(Text1.Text))

mont = Int (Val(Text2.Text))

day = Int(Val(Text3.Text))

birthday = DateSerial(year, month, day)

dateofweek = Weekday(birthday)

Label5.Caption = WeekdayName(dateofweek)

End Sub

Function myweekdayname(dayofweek As Byte)As String

Select Case dayofweek

case1: my WeekdayName = "星期天"

Else

myweekdayname = "非星期天"

End Select

End Function

原创粉丝点击