📄 第7章编程第1题b.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2370
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2370
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Height = 375
Left = 2520
TabIndex = 4
Text = " "
Top = 1320
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "检验"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 3
Top = 480
Width = 975
End
Begin VB.TextBox Text3
Height = 375
Left = 480
TabIndex = 2
Text = " "
Top = 1680
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 480
TabIndex = 1
Text = " "
Top = 960
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 480
TabIndex = 0
Text = " "
Top = 240
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim a As String, b As String, c As String
a = Trim(Text1.Text)
b = Trim(Text2.Text)
c = Trim(Text3.Text)
If che(a) And che(b) And che(c) Then
Text4.Text = Val(a) + Val(b) + Val(c)
Else
Text4.Text = "存在非数字字符"
End If
End Sub
Function che(x As String) As Boolean
If Trim(Str(Val(x))) = x Then
che = True
Else
che = False
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -