📄 frmoffice.frm
字号:
Begin VB.Menu MnuTime
Caption = "插入时间"
End
End
Begin VB.Menu MnuOut
Caption = "外部程序"
Begin VB.Menu MnuExpl
Caption = "资源管理器"
End
Begin VB.Menu Sepa12
Caption = "-"
End
Begin VB.Menu MnuWeb
Caption = "浏览器"
End
Begin VB.Menu MnuEmail
Caption = "电子邮件"
End
Begin VB.Menu Sepa13
Caption = "-"
End
Begin VB.Menu MnuAddress
Caption = "通讯录"
End
Begin VB.Menu MnuNote
Caption = "记事本"
End
Begin VB.Menu Sepa14
Caption = "-"
End
Begin VB.Menu MnuImage
Caption = "图像处理"
End
End
Begin VB.Menu Mnuhelp
Caption = "帮助"
Begin VB.Menu MnuAbout
Caption = "关于"
End
End
End
Attribute VB_Name = "Frmoffice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As Boolean
Dim filepath As String
Dim saveoption As Integer
Dim col As Integer
Dim place As Integer
Dim history(1 To 10) As String
Dim tempsize As Integer
Dim tempoffset As Integer
Private Sub Command1_Click()
Me.StatusBar1.Panels(1).Text = Me.RichTextBox1.SelLength
End Sub
Private Sub Combo1_Change()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelFontName = Me.Combo1.Text
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub Combo1_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelFontName = Me.Combo1.Text
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub Combo2_Change()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelFontSize = Me.Combo2.Text
If Not (Err.Number = 0) Then MsgBox Err.Description
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub Combo2_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelFontSize = Me.Combo2.Text
If Not (Err.Number = 0) Then MsgBox Err.Description
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub Form_Load()
For i = 1 To 10
history(i) = ""
Next i
For i = 1 To 100
Me.Combo2.AddItem i
Next i
Me.Combo2.ListIndex = 9
Me.Text1.Text = 0
Me.Toolbar2.Buttons(9).Value = tbrPressed
Me.SpinButton1.Value = 30
Load Frmfind
Frmfind.Hide
Frmfind.Enabled = False
filepath = ""
saveoption = 0
flag = True
place = 10
tempoffset = 0
tempsize = 10
Me.Picture1.BackColor = RGB(0, 0, 0)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Not (Me.RichTextBox1.Text = "") Then
response = MsgBox("需要保存当前文件吗?", 48 + 3, "提示信息")
If response = vbYes Then
Me.CommonDialog1.ShowSave
Me.RichTextBox1.SaveFile Me.CommonDialog1.FileName, 1
filepath = Me.CommonDialog1.FileName
ElseIf response = vbNo Then
End
Else
Exit Sub
End If
End If
End Sub
Private Sub Form_Terminate()
If Not (Err.Number = 0) Then
MsgBox Err.Description
Else
If Not (Me.RichTextBox1.Text = "") Then
response = MsgBox("需要保存当前文件吗?", 48 + 3, "提示信息")
If response = vbYes Then
Me.CommonDialog1.ShowSave
Me.RichTextBox1.SaveFile Me.CommonDialog1.FileName, 1
ElseIf response = vbNo Then
End
Else
Exit Sub
End If
End If
End If
main.Show
End Sub
Private Sub format_Click()
End Sub
Private Sub MnuBackColor_Click()
Me.CommonDialog1.ShowColor
Me.RichTextBox1.BackColor = Me.CommonDialog1.Color
End Sub
Private Sub MnuBold_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Me.Toolbar1.Buttons.Item(16).Value = tbrPressed Then
Me.RichTextBox1.SelBold = True
ElseIf Me.Toolbar1.Buttons.Item(16).Value = tbrUnpressed Then
Me.RichTextBox1.SelBold = False
Else
End If
End If
End Sub
Private Sub MnuCenter_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Me.Toolbar1.Buttons.Item(25).Value = tbrPressed Then Me.RichTextBox1.SelAlignment = 2
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub MnuCopy_Click()
Clipboard.SetText Me.RichTextBox1.SelText
End Sub
Private Sub MnuCover_Click()
If Me.Toolbar2.Buttons(12).Value = tbrPressed Then
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Not IsNull(Me.RichTextBox1.SelFontSize) Then tempsize = Me.RichTextBox1.SelFontSize
If Not IsNull(Me.RichTextBox1.SelCharOffset) Then tempoffset = Me.RichTextBox1.SelCharOffset
If Not IsNull(Me.RichTextBox1.SelColor) Then Me.Picture1.BackColor = Me.RichTextBox1.SelColor
Me.RichTextBox1.SelFontSize = 1
Me.RichTextBox1.SelCharOffset = 700
Me.RichTextBox1.SelColor = Me.RichTextBox1.BackColor
End If
Else
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelColor = Me.Picture1.BackColor
Me.RichTextBox1.SelFontSize = tempsize
Me.RichTextBox1.SelCharOffset = tempoffset
Me.Picture1.BackColor = RGB(0, 0, 0)
tempsize = 10
tempoffset = 0
End If
End If
End Sub
Private Sub MnuCut_Click()
Clipboard.SetText Me.RichTextBox1.SelText
Me.RichTextBox1.SelText = ""
End Sub
Private Sub MnuDelete_Click()
Me.RichTextBox1.SelText = ""
End Sub
Private Sub MnuEmph_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Me.Toolbar1.Buttons(32).Value = tbrPressed Then
Me.RichTextBox1.SelBullet = True
Else
Me.RichTextBox1.SelBullet = False
End If
End If
End Sub
Private Sub MnuExit_Click()
End
End Sub
Private Sub MnuExpl_Click()
response = Shell("C:\windows\explorer.exe", vbNormalNoFocus)
End Sub
Private Sub MnuFind_Click()
Frmfind.Show
Frmfind.Enabled = True
End Sub
Private Sub MnuFirst_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelText = StrConv(Me.RichTextBox1.SelText, vbProperCase)
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub MnuFontColor_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.CommonDialog1.ShowColor
Me.RichTextBox1.SelColor = Me.CommonDialog1.Color
End If
End Sub
Private Sub MnuItalic_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Me.Toolbar1.Buttons.Item(17).Value = tbrPressed Then
Me.RichTextBox1.SelItalic = True
ElseIf Me.Toolbar1.Buttons.Item(17).Value = tbrUnpressed Then
Me.RichTextBox1.SelItalic = False
Else
End If
End If
End Sub
Private Sub MnuKey_Click()
Load FrmKey
FrmKey.Show
End Sub
Private Sub MnuLcase_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
Me.RichTextBox1.SelText = LCase(Me.RichTextBox1.SelText)
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub MnuLeft_Click()
If (Me.RichTextBox1.SelProtected = True) Or IsNull(Me.RichTextBox1.SelProtected) Then
Call protect
Else
If Me.Toolbar1.Buttons.Item(24).Value = tbrPressed Then Me.RichTextBox1.SelAlignment = 0
If Not (Err.Number = 0) Then MsgBox Err.Description
End If
End Sub
Private Sub MnuLock_Click()
Load FrmLockup
FrmLockup.Show
End Sub
Private Sub MnuNew_Click()
saveoption = 0
If Not (Me.RichTextBox1.Text = "") Then
response = MsgBox("需要保存当前文件吗?", 48 + 3, "提示信息")
If response = vbYes Then
Me.CommonDialog1.ShowSave
Me.RichTextBox1.SaveFile Me.CommonDialog1.FileName, 1
filepath = Me.CommonDialog1.FileName
ElseIf response = vbNo Then
Me.RichTextBox1.Text = ""
Else
Exit Sub
End If
End If
End Sub
Private Sub MnuNote_Click()
response = Shell("C:\windows\Notepad.exe", vbNormalNoFocus)
End Sub
Private Sub Mnuopen_Click()
If Not (Me.RichTextBox1.Text = "") Then
response = MsgBox("需要保存当前文件吗?", 48 + 3, "提示信息")
If response = vbYes Then
If saveoption = 0 Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -