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

📄 例[9-13].frm

📁 蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 Visual Basic 程序设计教程(第四版) 主编 蒋加伏 张林峰 找了好久的(不带密码的)
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.OCX"
Begin VB.Form Form1 
   Caption         =   "例[9-13] 文本文件编辑程序"
   ClientHeight    =   3180
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   3675
   LinkTopic       =   "Form1"
   ScaleHeight     =   3180
   ScaleWidth      =   3675
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CD1 
      Left            =   840
      Top             =   2640
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton cmdQuit 
      Caption         =   "结束"
      Height          =   375
      Left            =   2400
      TabIndex        =   6
      Top             =   2520
      Width           =   1095
   End
   Begin VB.CommandButton cmdPrint 
      Caption         =   "打印..."
      Height          =   375
      Left            =   2400
      TabIndex        =   5
      Top             =   2040
      Width           =   1095
   End
   Begin VB.CommandButton cmdFont 
      Caption         =   "字体..."
      Height          =   375
      Left            =   2400
      TabIndex        =   4
      Top             =   1560
      Width           =   1095
   End
   Begin VB.CommandButton cmdColor 
      Caption         =   "颜色..."
      Height          =   375
      Left            =   2400
      TabIndex        =   3
      Top             =   1080
      Width           =   1095
   End
   Begin VB.CommandButton cmdSaveas 
      Caption         =   "另存为..."
      Height          =   375
      Left            =   2400
      TabIndex        =   2
      Top             =   600
      Width           =   1095
   End
   Begin VB.CommandButton cmdOpen 
      Caption         =   "打开..."
      Height          =   375
      Left            =   2400
      TabIndex        =   1
      Top             =   120
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   2175
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Top             =   360
      Width           =   2175
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOpen_Click()
  CD1.ShowOpen
  '打开对话框中选择的文件名(包括路径)显示在文本框中
  Text1.Text = CD1.FileName
End Sub
Private Sub cmdSaveas_Click()
  CD1.DefaultExt = "txt"    '保存文件时的缺省类型是文本文档
  CD1.ShowSave
  '将文本框中的内容写入指定文本文档
  Open CD1.FileName For Output As #1
     Print #1, Text1.Text
  Close #1
End Sub
Private Sub cmdColor_Click()
  CD1.ShowColor
  '用在颜色对话框中选择的颜色设置文本框字体
  Text1.ForeColor = CD1.Color
End Sub

Private Sub cmdFont_Click()
 '显示打印机和屏幕字体,并在字体对话框显示删除线和下划线检查框以及颜色组合框
  CD1.Flags = cdlCFBoth Or cdlCFEffects
  CD1.ShowFont
  '在字体对话框中选择不同的内容设置文本框中的字体
  Text1.FontName = CD1.FontName
  Text1.FontSize = CD1.FontSize
  Text1.FontBold = CD1.FontBold
  Text1.FontItalic = CD1.FontItalic
  Text1.FontUnderline = CD1.FontUnderline
End Sub
Private Sub cmdPrint_Click()
  CD1.ShowPrinter
  Printer.Print Text1.Text    '打印文本框内容
End Sub
Private Sub cmdQuit_Click()
  End
End Sub

⌨️ 快捷键说明

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