例[9-7].frm

来自「蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 」· FRM 代码 · 共 67 行

FRM
67
字号
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.OCX"
Begin VB.Form Form1 
   Caption         =   "例[9-7] 编辑文本文件"
   ClientHeight    =   1845
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   3675
   LinkTopic       =   "Form1"
   ScaleHeight     =   1845
   ScaleWidth      =   3675
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   1080
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command1 
      Caption         =   "编辑文本文件"
      Height          =   495
      Left            =   840
      TabIndex        =   1
      Top             =   720
      Width           =   1695
   End
   Begin VB.Label Label1 
      Height          =   375
      Left            =   960
      TabIndex        =   0
      Top             =   2160
      Width           =   495
   End
   Begin VB.Menu Edit 
      Caption         =   "编辑"
      Visible         =   0   'False
      Begin VB.Menu Cut 
         Caption         =   "剪切"
      End
      Begin VB.Menu Copy 
         Caption         =   "复制"
      End
      Begin VB.Menu Paste 
         Caption         =   "粘贴"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Load()
  CommonDialog1.FileName = " * .txt"
  CommonDialog1.InitDir = "c:\"
  CommonDialog1.Filter = "文本文件(*.txt)|*.txt|All File(*.*)|*.*"
  FilterIndex = 1
End Sub
Private Sub Command1_Click()
  CommonDialog1.Action = 1
  PathName = "C:\WINDOWS\NOTEPAD.EXE" + " " + CommonDialog1.FileName
  ReturnValue = Shell(PathName, 1)    '用记事本程序打开选定的文本文件
End Sub

⌨️ 快捷键说明

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