VB 星座查询代码
Private Sub Command1_Click() Dim str1 As String, d1 As Date, i As Integer, xz xz = Array("白羊座", 3, 21, 4, 20, "金牛座", 4, 21, 5, 20, "双子座", 5, 21, 6, 21, _ "巨蟹座", 6, 22, 7, 22, "狮子座", 7, 23, 8, 22, "处女座", 8, 23, 9, 22, _ "天秤座", 9, 23, 10, 22, "天蝎座", 10, 23, 11, 21, "射手座", 11, 22, 12, 21, _ "摩羯座", 12, 22, 12, 31, "摩羯座", 1, 1, 1, 19, "水瓶座", 1, 20, 2, 18, _ "双鱼座", 2, 19, 3, 20) str1 = txtMonth & "-" & txtDay If IsDate(str1) Then 'd1 = CDate(str1) For i = 0 To UBound(xz) Step 5 If Val(txtMonth) >= xz(i + 1) And Val(txtDay) >= xz(i + 2) _ And Val(txtMonth) <= xz(i + 3) And Val(txtDay) <= xz(i + 4) Then MsgBox "你查询的" & str1 & "的星座" & xz(i), vbOKOnly, "星座查询" Exit For End If Next i Else MsgBox "你输入的数据" & str1 & "不是日期!", vbOKOnly, "星座查询" End If End Sub
以上就是与科技紫薇星座每日查询以及紫微科技星座的相关内容,也是关于VB 星座查询代码的分享。看完科技紫薇星座每日查询一文后,希望这对大家有所帮助!