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

📄 frmsetup.frm

📁 VB automaticlly grap error event
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSetup 
   BackColor       =   &H00660000&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Auto Error Handling Addin"
   ClientHeight    =   4050
   ClientLeft      =   2385
   ClientTop       =   3060
   ClientWidth     =   6825
   Icon            =   "frmSetup.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4050
   ScaleWidth      =   6825
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Clear"
      Height          =   375
      Index           =   5
      Left            =   4620
      TabIndex        =   9
      ToolTipText     =   "Clear Error Code"
      Top             =   1440
      Width           =   900
   End
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Err Desc"
      Height          =   375
      Index           =   4
      Left            =   3720
      TabIndex        =   8
      ToolTipText     =   "Error Description"
      Top             =   1440
      Width           =   900
   End
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Err Num"
      Height          =   375
      Index           =   3
      Left            =   2820
      TabIndex        =   7
      ToolTipText     =   "Error Number"
      Top             =   1440
      Width           =   900
   End
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Mod"
      Height          =   375
      Index           =   2
      Left            =   1920
      TabIndex        =   6
      ToolTipText     =   "The module Name"
      Top             =   1440
      Width           =   900
   End
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Proc"
      Height          =   375
      Index           =   1
      Left            =   1020
      TabIndex        =   5
      ToolTipText     =   "Procedure Name"
      Top             =   1440
      Width           =   900
   End
   Begin VB.CommandButton cmdConstants 
      Caption         =   "Date"
      Height          =   375
      Index           =   0
      Left            =   120
      TabIndex        =   4
      ToolTipText     =   "Now Function"
      Top             =   1440
      Width           =   900
   End
   Begin VB.TextBox txtErrorCode 
      Height          =   2055
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   3
      Top             =   1920
      Width           =   6495
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "OK"
      Height          =   375
      Left            =   5520
      TabIndex        =   0
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "LiquidDragon Programming"
      ForeColor       =   &H00AF4F00&
      Height          =   255
      Left            =   4800
      TabIndex        =   2
      Top             =   1080
      Width           =   2175
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Code by Nathan Dennis"
      ForeColor       =   &H00AF4F00&
      Height          =   255
      Left            =   4800
      TabIndex        =   1
      Top             =   840
      Width           =   2175
   End
   Begin VB.Image Image1 
      Height          =   1200
      Left            =   0
      Picture         =   "frmSetup.frx":0442
      Stretch         =   -1  'True
      Top             =   0
      Width           =   5280
   End
End
Attribute VB_Name = "frmSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Sub cmdConstants_Click(Index As Integer)
Dim strNewCode As String
    'This just adds some of the most common text to the text box
    
    Select Case Index
        Case 0
            strNewCode = "Now(),"
        Case 1
            strNewCode = "ProcName,"
        Case 2
            strNewCode = "Me.Name,"
        Case 3
            strNewCode = "Err.Number,"
        Case 4
            strNewCode = "Err.Description,"
        Case 5
            txtErrorCode.Text = ""
            Exit Sub
    End Select
            
    txtErrorCode.Text = txtErrorCode.Text & strNewCode
    
    txtErrorCode.SetFocus
    txtErrorCode.SelStart = Len(txtErrorCode.Text)
    
End Sub

Private Sub Form_Activate()
    'Makes the form sit on top
    SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub

Private Sub Form_Load()
    'Make the class get the latest code from the file or reg
    ErrorHandle.GetErrorCode
    'The enter it into the text box
    txtErrorCode.Text = ErrorHandle.ErrorCode
End Sub

Private Sub Form_Unload(Cancel As Integer)
    'This calls a sub in the class to save the text to the reg and a file
    ErrorHandle.SaveErrorCode txtErrorCode.Text
End Sub

Private Sub OKButton_Click()
    Unload Me
End Sub


⌨️ 快捷键说明

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