📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form frmisnumeric
Caption = "Using IsNumeric, Val and Str$"
ClientHeight = 1530
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 1530
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtInput
Height = 285
Left = 0
TabIndex = 2
Top = 360
Width = 4695
End
Begin VB.CommandButton cmdIsNumeric
Caption = "IsNumeric?"
Height = 375
Left = 0
TabIndex = 1
Top = 720
Width = 1815
End
Begin VB.Label lblOutput
Height = 255
Left = 0
TabIndex = 3
Top = 1200
Width = 4695
End
Begin VB.Label lblInput
Caption = "Enter a string"
Height = 255
Left = 0
TabIndex = 0
Top = 120
Width = 2295
End
End
Attribute VB_Name = "frmisnumeric"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 8.13
' Using IsNumeric, Val and Str$
Option Explicit
Private Sub cmdIsNumeric_Click()
If IsNumeric(txtInput.Text) Then
lblOutput.Caption = txtInput.Text & " + 10 is " & _
Str$(Val(txtInput.Text) + 10)
Else
lblOutput.Caption = txtInput.Text & " is not a number"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -