form1.frm

来自「本文件包含200个visual baisc实例」· FRM 代码 · 共 52 行

FRM
52
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "判断闰年"
   ClientHeight    =   1380
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3330
   LinkTopic       =   "Form1"
   ScaleHeight     =   1380
   ScaleWidth      =   3330
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   390
      Left            =   975
      TabIndex        =   1
      Top             =   765
      Width           =   1380
   End
   Begin VB.CommandButton Command1 
      Caption         =   "判断"
      Height          =   390
      Left            =   975
      TabIndex        =   0
      Top             =   240
      Width           =   1380
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'定义两个变量
  Dim year As Integer
  Dim myval As Boolean
  year = InputBox("请输入年", "闰年判断")
'显示输入框
  If (year Mod 400) = 0 Then
      myval = True
      MsgBox "此年为闰年", vbInformation, "闰年判断"
    Else
      myval = False
      MsgBox "此年不是闰年", vbInformation, "闰年判断"
  End If
End Sub

Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?