📄 baguwen.bas
字号:
Attribute VB_Name = "mdlBaguwen"
Option Explicit
Public g_fMainForm As frmMain
Sub Main()
Set g_fMainForm = New frmMain
g_fMainForm.Show
End Sub
Public Sub LoadNewDoc()
Dim fNewForm As New frmChild
Static lDocumentCount As Long
lDocumentCount = lDocumentCount + 1
'将新窗体的标题设为“未定标题”+数字
fNewForm.Caption = "未定标题 " & lDocumentCount
fNewForm.Show
fNewForm.m_bModify = False
End Sub
Public Sub OpenDoc()
'打开文档
Dim sFile As String
With g_fMainForm.dlgCommonDialog
.DialogTitle = "Open"
.CancelError = False
'ToDo: set the flags and attributes of the common dialog control
.Filter = "Text (*.txt)|*.txt|RTFText (*.rtf)|*.rtf|All Files (*.*)|*.*"
.FilterIndex = 1
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
End With
LoadNewDoc
g_fMainForm.ActiveForm.rtfText.LoadFile sFile
g_fMainForm.ActiveForm.Caption = sFile
g_fMainForm.ActiveForm.m_bModify = False
End Sub
Public Sub ExitProgram()
'退出程序
Unload g_fMainForm
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -