📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form frmAscChr
BorderStyle = 1 'Fixed Single
Caption = "Demonstrating Asc and Chr"
ClientHeight = 2325
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2325
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtOutputInt
Enabled = 0 'False
Height = 285
Left = 120
TabIndex = 7
Top = 1920
Width = 4455
End
Begin VB.TextBox txtOutputChar
Enabled = 0 'False
Height = 285
Left = 120
TabIndex = 6
Top = 720
Width = 4455
End
Begin VB.CommandButton cmdConvertChar
Caption = "Show corresponding integer"
Height = 285
Left = 2160
TabIndex = 5
Top = 1560
Width = 2415
End
Begin VB.CommandButton cmdConvertInt
Caption = "Show corresponding character"
Height = 285
Left = 2160
TabIndex = 4
Top = 360
Width = 2415
End
Begin VB.TextBox txtInputChar
Height = 285
Left = 120
TabIndex = 1
Top = 1560
Width = 1935
End
Begin VB.TextBox txtInputInt
Height = 285
Left = 120
TabIndex = 0
Top = 360
Width = 1935
End
Begin VB.Line Line1
X1 = 120
X2 = 4560
Y1 = 1200
Y2 = 1200
End
Begin VB.Label Label2
Caption = "Enter a character or string to convert to an integer"
Height = 255
Left = 120
TabIndex = 3
Top = 1320
Width = 4455
End
Begin VB.Label Label1
Caption = "Enter an integer to convert to a character"
Height = 255
Left = 120
TabIndex = 2
Top = 120
Width = 4455
End
End
Attribute VB_Name = "frmAscChr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 8.12
' Demonstrating
Option Explicit
Private Sub cmdConvertInt_Click()
txtOutputChar.Text = _
"The character value of " & txtInputInt.Text & _
" is " & Chr$(txtInputInt.Text)
End Sub
Private Sub cmdConvertChar_Click()
txtOutputInt.Text = _
"The ASCII value of " & txtInputChar.Text & " is " & _
Asc(txtInputChar.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -