Case 1 ' 余数为1则当天是星期二 Text2.Text = \星期二\ Case 2
Text2.Text = \星期三\ Case 3
Text2.Text = \星期四\ Case 4
Text2.Text = \星期五\ Case 5
Text2.Text = \星期六\ Case Else
Text2.Text = \星期日\ End Select End Sub
3、比较大小程序 文本框分别为text1 text2 标签是 label1
Private Sub Command1_Click() Dim x As Integer, y As Integer x = Val(Text1.Text): y = Val(Text2.Text)
If x < y Then '判断x>y是否为真如果为真执行下面程序 Label1.Caption = \ElseIf x > y Then Label1.Caption = \Else
Label1.Caption = \ End If End Sub