【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“Ex2_10.frm”一文,供大家参考学习!
VERSION 5.00
Begin VB.Form Ex2_10
Caption = "Form1"
ClientHeight = 1905
ClientLeft = 60
ClientTop = 450
ClientWidth = 4230
LinkTopic = "Form1"
ScaleHeight = 1905
ScaleWidth = 4230
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 375
Left = 2880
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 240
TabIndex = 1
Top = 1080
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "查看"
Height = 375
Left = 360
TabIndex = 0
Top = 360
Width = 1095
End
Begin
VB.Label Label1
Caption = "年元旦是星期"
Height = 255
Left = 1680
TabIndex = 2
Top = 1200
Width = 1095
End
End
Attribute VB_Name = "Ex2_10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim y As Integer, f As Integer, k As Integer '定义三个变量
y = Val(Text1.Text) '获得text1中的数字内容
f = Int((y - 1) * (1 + 1 / 4 - 1 / 100 + 1 / 400) + 1)
k = f - Int(f / 7) * 7
Text2.Text = k
End Sub