标题: vb十二生肖程序 根据年份的输入便可以查询到你是什么生肖 [打印本页]

作者: 一只uu    时间: 2016-6-12 10:41
标题: vb十二生肖程序 根据年份的输入便可以查询到你是什么生肖
这是基于十二生肖的,根据年份的输入便可以查询到你是什么生肖,输入年份后,会将生肖定位,以实现生肖的属性。

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3.    Caption         =   "生肖查询"
  4.    ClientHeight    =   1695
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4245
  8.    Icon            =   "Form1.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   1695
  11.    ScaleWidth      =   4245
  12.    StartUpPosition =   1  '所有者中心
  13.    Begin VB.CommandButton Command2
  14.       BackColor       =   &H00FFC0C0&
  15.       Caption         =   "退出"
  16.       Height          =   450
  17.       Left            =   2250
  18.       Style           =   1  'Graphical
  19.       TabIndex        =   3
  20.       Top             =   1080
  21.       Width           =   1395
  22.    End
  23.    Begin VB.CommandButton Command1
  24.       BackColor       =   &H00FFC0C0&
  25.       Caption         =   "生肖"
  26.       Height          =   450
  27.       Left            =   510
  28.       Style           =   1  'Graphical
  29.       TabIndex        =   0
  30.       Top             =   1080
  31.       Width           =   1395
  32.    End
  33.    Begin VB.Label Label1
  34.       BeginProperty Font
  35.          Name            =   "宋体"
  36.          Size            =   12
  37.          Charset         =   134
  38.          Weight          =   400
  39.          Underline       =   0   'False
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.       Height          =   495
  44.       Left            =   105
  45.       TabIndex        =   2
  46.       Top             =   315
  47.       Width           =   3180
  48.    End
  49.    Begin VB.Label Label2
  50.       BeginProperty Font
  51.          Name            =   "宋体"
  52.          Size            =   15
  53.          Charset         =   134
  54.          Weight          =   700
  55.          Underline       =   0   'False
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       ForeColor       =   &H000000FF&
  60.       Height          =   495
  61.       Left            =   3315
  62.       TabIndex        =   1
  63.       Top             =   315
  64.       Width           =   810
  65.    End
  66. End
  67. Attribute VB_Name = "Form1"
  68. Attribute VB_GlobalNameSpace = False
  69. Attribute VB_Creatable = False
  70. Attribute VB_PredeclaredId = True
  71. Attribute VB_Exposed = False
  72. Private Sub Command1_Click()
  73. 'Download by http://down.liehuo.net
  74.   Dim Year As Integer
  75.   Dim Name As Integer
  76.   Year = Val(InputBox("请输人出生年份:", "生肖查询", 1977))
  77.   Label1.Caption = "您是" & Str(Year) + "年出生的生肖为:"
  78.   Name = Year Mod 12
  79.   Select Case Name
  80.     Case 4
  81.       Label2.Caption = "鼠"
  82.     Case 5
  83.       Label2.Caption = "牛"
  84.     Case 6
  85.       Label2.Caption = "虎"
  86.     Case 7
  87.       Label2.Caption = "兔"
  88.     Case 8
  89.       Label2.Caption = "龙"
  90.     Case 9
  91.       Label2.Caption = "蛇"
  92.     Case 10
  93.       Label2.Caption = "马"
  94.     Case 11
  95.       Label2.Caption = "羊"
  96.     Case 0
  97.       Label2.Caption = "猴"
  98.     Case 1
  99.       Label2.Caption = "鸡"
  100.     Case 2
  101.       Label2.Caption = "狗"
  102.     Case 3
  103.       Label2.Caption = "猪"
  104.    End Select
  105. End Sub
  106. Private Sub Command2_Click()
  107.   End
  108. End Sub

复制代码


shengxiao.rar

3.63 KB, 下载次数: 8, 下载积分: 黑币 -5






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1