📄 frmsdi.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmSDI
Caption = "SDI 记事本 - 无标题"
ClientHeight = 5364
ClientLeft = 312
ClientTop = 1476
ClientWidth = 6696
LinkTopic = "Form1"
ScaleHeight = 5364
ScaleWidth = 6696
Begin VB.TextBox txtNote
Height = 3975
HideSelection = 0 'False
Left = 0
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 480
Width = 5655
End
Begin VB.PictureBox picToolbar
Align = 1 'Align Top
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 0
ScaleHeight = 360
ScaleWidth = 6648
TabIndex = 1
Top = 0
Width = 6690
Begin MSComDlg.CommonDialog CMDialog1
Left = 1995
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
DefaultExt = "TXT"
Filter = "工程(*.zdm)|*.zdm|数据文件(*.dat)|*.dat|所有文件(*.*)|*.*"
FilterIndex = 473
FontSize = 7.98198e-38
End
Begin VB.Image imgFileNewButton
Height = 264
Left = 0
Picture = "frmsdi.frx":0000
ToolTipText = "新建文件"
Top = 0
Width = 288
End
Begin VB.Image imgFileOpenButton
Height = 264
Left = 360
Picture = "frmsdi.frx":018A
ToolTipText = "打开文件"
Top = 0
Width = 288
End
Begin VB.Image imgCutButton
Height = 264
Left = 840
Picture = "frmsdi.frx":0314
ToolTipText = "剪切"
Top = 0
Width = 300
End
Begin VB.Image imgCopyButton
Height = 264
Left = 1200
Picture = "frmsdi.frx":04F6
ToolTipText = "复制"
Top = 0
Width = 300
End
Begin VB.Image imgPasteButton
Height = 264
Left = 1560
Picture = "frmsdi.frx":06D8
ToolTipText = "粘贴"
Top = 0
Width = 300
End
Begin VB.Image imgFileNewButtonDn
Height = 264
Left = 2040
Picture = "frmsdi.frx":08BA
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgFileNewButtonUp
Height = 264
Left = 2400
Picture = "frmsdi.frx":0A9C
Top = 0
Visible = 0 'False
Width = 288
End
Begin VB.Image imgFileOpenButtonUp
Height = 264
Left = 3120
Picture = "frmsdi.frx":0C26
Top = 0
Visible = 0 'False
Width = 288
End
Begin VB.Image imgFileOpenButtonDn
Height = 264
Left = 2760
Picture = "frmsdi.frx":0DB0
Top = 0
Visible = 0 'False
Width = 288
End
Begin VB.Image imgCutButtonUp
Height = 264
Left = 3480
Picture = "frmsdi.frx":0F3A
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgCutButtonDn
Height = 264
Left = 3840
Picture = "frmsdi.frx":111C
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgCopyButtonUp
Height = 264
Left = 4560
Picture = "frmsdi.frx":12FE
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgCopyButtonDn
Height = 264
Left = 4200
Picture = "frmsdi.frx":14E0
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgPasteButtonDn
Height = 264
Left = 4920
Picture = "frmsdi.frx":16C2
Top = 0
Visible = 0 'False
Width = 300
End
Begin VB.Image imgPasteButtonUp
Height = 264
Left = 5280
Picture = "frmsdi.frx":18A4
Top = 0
Visible = 0 'False
Width = 300
End
End
Begin VB.Menu mnuFile
Caption = "文件(&F)"
Begin VB.Menu mnuFileNew
Caption = "新建(&N)"
End
Begin VB.Menu mnuFileOpen
Caption = "打开(&O)"
End
Begin VB.Menu mnuFileSave
Caption = "保存(&S)"
End
Begin VB.Menu mnuFileSaveAs
Caption = "另存为(&A)"
End
Begin VB.Menu mnuFSep1
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "退出(&X)"
End
Begin VB.Menu mnuRecentFile
Caption = "-"
Index = 0
Visible = 0 'False
End
Begin VB.Menu mnuRecentFile
Caption = "RecentFile1"
Index = 1
Visible = 0 'False
End
Begin VB.Menu mnuRecentFile
Caption = "RecentFile2"
Index = 2
Visible = 0 'False
End
Begin VB.Menu mnuRecentFile
Caption = "RecentFile3"
Index = 3
Visible = 0 'False
End
Begin VB.Menu mnuRecentFile
Caption = "RecentFile4"
Index = 4
Visible = 0 'False
End
Begin VB.Menu mnuRecentFile
Caption = "RecentFile5"
Index = 5
Visible = 0 'False
End
End
Begin VB.Menu mnuEdit
Caption = "编辑(&E)"
Begin VB.Menu mnuEditCut
Caption = "剪切(&T)"
Shortcut = ^X
End
Begin VB.Menu mnuEditCopy
Caption = "复制(&C)"
Shortcut = ^C
End
Begin VB.Menu mnuEditPaste
Caption = "粘贴(&P)"
Shortcut = ^V
End
Begin VB.Menu mnuEditDelete
Caption = "删除(&L)"
Shortcut = {DEL}
End
Begin VB.Menu mnuEditSep1
Caption = "-"
End
Begin VB.Menu mnuEditSelectAll
Caption = "全选(&A)"
End
Begin VB.Menu mnuEditTime
Caption = "时间/日期(&D)"
End
End
Begin VB.Menu mnuSearch
Caption = "搜索(&S)"
Begin VB.Menu mnuSearchFind
Caption = "查找(&F)"
End
Begin VB.Menu mnuSearchFindNext
Caption = "查找下一个(&N)"
Shortcut = {F3}
End
End
Begin VB.Menu mnuOptions
Caption = "选项(&O)"
Begin VB.Menu mnuOptionsToolbar
Caption = "工具栏(&T)"
End
Begin VB.Menu mnuFonts
Caption = "字体(&F)"
Begin VB.Menu mnuFontName
Caption = "字体名称"
Index = 0
End
End
Begin VB.Menu mnuOptionsLaunch
Caption = "执行新的实例(&L)"
End
End
End
Attribute VB_Name = "frmSDI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*** SDI 记事本示例应用程序的主窗体 ***
'**********************************************************
Option Explicit
Private Sub Form_Load()
Dim i As Integer ' 计数器变量
' 应用程序从这里开始 (加在启动窗体事件)。
Show
' 总是将工作路径设置到包含此应用程序的路径。
ChDir App.Path
FState.Dirty = False
' 对系统注册表并且设置最近菜单文件列表控件数组属性。
GetRecentFiles
' 设置公共变量 gFindDirection ,它来决定
' FindIt 函数将搜索的方向。
gFindDirection = 1
' 分配递一个字体的名称到
' 字体菜单条目, 然后遍历字体
' 集合, 添加它们到菜单中
mnuFontName(0).Caption = Screen.Fonts(0)
For i = 1 To Screen.FontCount - 1
Load mnuFontName(i)
mnuFontName(0).Caption = Screen.Fonts(i)
Next
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim strMsg As String
Dim strFilename As String
Dim intResponse As Integer
' 检查看文本是否已经被更改。
If FState.Dirty Then
strFilename = Me.Caption
strMsg = "The text in [" & strFilename & "] has changed."
strMsg = strMsg & vbCrLf
strMsg = strMsg & "您是否希望保存此更改?"
intResponse = MsgBox(strMsg, 51, frmSDI.Caption)
Select Case intResponse
Case 6 ' 用户选择是
If Left(Me.Caption, 8) = "无标题" Then
' 文件还没有被保存。
strFilename = "untitled.txt"
' 获得 strFilename, 然后调用保存过程 GetstrFilename。
strFilename = GetFileName(strFilename)
Else
' 窗体的标题包含打开的文件名称。
strFilename = Me.Caption
End If
' 调用保存过程。如果 strFilename = Empty,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -