VB制做星座测试的代码

来源:百度知道 编辑:UC知道 时间:2024/07/07 21:01:18
怎样用VB制做一个用来测试你的星座的VB代码

我来回答:
在窗体添加 一个label,text1(月,如12),text2(日期,如12),三个按钮,OK~

你把代码复制进去就好了 ~~
Private Sub Command1_Click()'检测你是什么星座
a = Val(Text1.Text)
b = Val(Text2.Text)
C = a * 100 + b

Label1.Caption = "魔羯座"

If C > 1221 Then C = 0

If C > 119 Then
Label1.Caption = "水瓶座"
End If

If C > 218 Then
Label1.Caption = "双鱼座"
End If

If C > 320 Then
Label1.Caption = "白羊座"
End If

If C > 420 Then
Label1.Caption = "金牛座"
End If

If C > 520 Then
Label1.Caption = "双子座"
End If

If C > 621 Then
Label1.Caption = "巨蟹座"

End If

If C > 722 Then
Label1.Caption = "狮子座"
End If

If C > 822 Then
Label