⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 例10.14.frm

📁 一本学习Visual Basic编程的好书
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2205
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2205
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "判断休息日和工作日"
      Height          =   495
      Left            =   1350
      TabIndex        =   0
      Top             =   825
      Width           =   2025
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Enum weekdays         '定义Weekdays为枚举类型
    sun
    Mon
    Tue
    Wed
    Thu
    Fri
    sat
End Enum
Private Sub Command1_Click()
    Dim myday As weekdays       '定义Myday为Weekdays枚举类型
    myday = Val(InputBox("今天是星期几(0~6)"))   '输入0~6
    If myday < sun Or myday > sat Then
        MsgBox "输入的星期数错误"
    Else
        If myday = sun Or myday = sat Then
            MsgBox "休息日"
        Else
            MsgBox "工作日"
        End If
    End If
End Sub

⌨️ 快捷键说明

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