📄 form2.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form2
BackColor = &H00404040&
BorderStyle = 1 'Fixed Single
Caption = "字数计算器"
ClientHeight = 5910
ClientLeft = 3930
ClientTop = 2115
ClientWidth = 7455
Icon = "Form2.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5910
ScaleWidth = 7455
Begin MSComDlg.CommonDialog CommonDialog1
Left = 6840
Top = 5040
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "清空文本"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5400
TabIndex = 3
Top = 5040
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "复制数据"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 2
Top = 5040
Width = 1215
End
Begin VB.CommandButton Command1
BackColor = &H00FFFFFF&
Caption = "计算字数"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 1
Top = 5040
Width = 1215
End
Begin VB.TextBox Text1
BackColor = &H00E0E0E0&
ForeColor = &H00FF0000&
Height = 4575
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 120
Width = 7215
End
Begin VB.Menu file
Caption = "文件(&F)"
Begin VB.Menu open
Caption = "打开...(&O)"
End
Begin VB.Menu eixt
Caption = "退出(&E)"
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim b$
b = Len(Text1.Text)
MsgBox "您输入的字数是" & b, vbExclamation, "提示!"
End Sub
Private Sub Command2_Click()
Dim s As String
Dim a
a = Len(Text1.Text)
If a = 0 Then
MsgBox "编辑框无数据!!!!", vbExclamation, "提示!"
Else
s = Text1.Text
Clipboard.SetText s
MsgBox "数据已经复制到系统剪贴版!!!!", vbExclamation, "提示!"
End If
End Sub
Private Sub Command3_Click()
Close #1
Text1.Text = ""
End Sub
Private Sub eixt_Click()
End
End Sub
Private Sub Form_Load()
On Error Resume Next
End Sub
Private Sub open_Click()
On Error Resume Next
Text1.Text = ""
CommonDialog1.FileName = ""
CommonDialog1.Flags = vbOFNFileMustExist
CommonDialog1.Filter = "Text Files(*.txt)|*.txt"
CommonDialog1.FilterIndex = 1
CommonDialog1.DialogTitle = "打开文件"
CommonDialog1.Action = 1
If CommonDialog1.FileName = "" Then
MsgBox "找不到文件!!!", vbExclamation, "提示!"
Else
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Input #1, a$
Text1.Text = Text1.Text & a$
Loop
Close #1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -