form1.frm

来自「vb电子书籍」· FRM 代码 · 共 44 行

FRM
44
字号
   VERSION 5.00
   Begin VB.Form Form1
      Caption         =   "错误处理"
      ClientHeight    =   2550
      ClientLeft      =   60
      ClientTop       =   345
      ClientWidth     =   6285
      LinkTopic       =   "Form1"
      ScaleHeight     =   2550
      ScaleWidth      =   6285
      StartUpPosition =   2  '屏幕中心
   End
   Attribute VB_Name = "Form1"
   Attribute VB_GlobalNameSpace = False
   Attribute VB_Creatable = False
   Attribute VB_PredeclaredId = True
   Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
'##################################################################
'## 过程名称:Form_Click
'## 参数: 无
'##################################################################
Private Sub Form_Click()
    On Error GoTo errorhandler
    FileCopy "a:\student.mdb", "c:\student.mdb"
    Exit Sub
    errorhandler:
    Select Case Err.Number
        Case 53
            Style = vbRetryCancel + vbCritical + vbDefaultButton2
            response = MsgBox("文件不存在!", Style, "出错号53")
        Case 71
            Style = vbRetryCancel + vbExclamation + vbDefaultButton2
            response = MsgBox("A盘未准备好!", Style, "出错号71")
        Case Else
            MsgBox Err.Number & "出错,退出本程序"
            Exit Sub
    End Select
    If response = vbCancel Then Exit Sub
    Resume
    
End Sub
    

⌨️ 快捷键说明

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