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

📄 9-6.frm

📁 vb编程+从基础到实践光盘代码
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "Command4"
      Height          =   495
      Left            =   3000
      TabIndex        =   4
      Top             =   2400
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   1815
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   3
      Top             =   240
      Width           =   3135
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   3360
      Top             =   1680
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Command3"
      Height          =   495
      Left            =   2040
      TabIndex        =   2
      Top             =   2400
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Command2"
      Height          =   495
      Left            =   1080
      TabIndex        =   1
      Top             =   2400
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   0
      TabIndex        =   0
      Top             =   2400
      Width           =   975
   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()
    With CommonDialog1
    .ShowOpen
    Open .FileName For Input As #1
    Text1.Text = Input$(Log(1), #1)
    Close #1
    End With
End Sub

Private Sub Command2_Click()
    On Error GoTo fileerror
    With CommonDialog1
    .ShowOpen
    Open .FileName For Input As #1
    Text1.Text = Input$(Log(1), #1)
    Close #1
    End With
fileerror:
    MsgBox "File Not Exit"
End Sub
Private Sub Command3_Click()
    On Error GoTo fileerror
    With CommonDialog1
   .ShowOpen
    Open .FileName For Input As #1
    Text1.Text = Input$(Log(1), #1)
    Close #1
    End With
    End Sub
fileerror:
    MsgBox "File Not Exit"
End Sub

Private Sub Command4_Click()
    On Error GoTo fileerror
    With CommonDialog1
    .ShowOpen
    Open .FileName For Input As #1
    Text1.Text = Input$(Log(1), #1)
    Close #1
    End With
    End Sub
fileerror:
    Select Case Err.Number
        Case cdlCancel
            MsgBox "Please select a file"
            Resume
        Case 53
            MsgBox "File not found"
        Case Default
            MsgBox "File Not Exit"
        End Select
End Sub

⌨️ 快捷键说明

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