来自「Visual Basic中,对于文本比较好的处理方式.」· 代码 · 共 45 行

TXT
45
字号
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1650
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   1650
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   3000
      Top             =   450
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开"
      Height          =   540
      Left            =   600
      TabIndex        =   0
      Top             =   450
      Width           =   1740
   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()
    CommonDialog1.DialogTitle = "打开文件"
                                   '设置文件过滤器
    CommonDialog1.Filter = "全部文件|*.*|文本文件|*.txt"
                                   '设置默认文件夹
    CommonDialog1.InitDir = "D:\"
    'CommonDialog1.InitDir = "c:\My Documents"
                                   '显示“打开”对话框
    CommonDialog1.ShowOpen
End Sub

⌨️ 快捷键说明

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