📄 汉字编码.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7380
ClientLeft = 120
ClientTop = 420
ClientWidth = 12435
LinkTopic = "Form1"
ScaleHeight = 7380
ScaleWidth = 12435
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "清除"
Height = 375
Left = 480
TabIndex = 6
Top = 2400
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
Left = 480
TabIndex = 2
Top = 1800
Width = 6375
End
Begin VB.TextBox Text2
Height = 615
Left = 480
TabIndex = 1
Top = 960
Width = 6375
End
Begin VB.TextBox Text1
Height = 495
Left = 480
TabIndex = 0
Top = 240
Width = 6015
End
Begin VB.Label Label3
Caption = "ASCII码"
Height = 495
Left = 8160
TabIndex = 5
Top = 1920
Width = 1455
End
Begin VB.Label Label2
Caption = "unicode码"
Height = 495
Left = 8280
TabIndex = 4
Top = 1080
Width = 1455
End
Begin VB.Label Label1
Caption = "输入汉字"
Height = 615
Left = 8280
TabIndex = 3
Top = 240
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function change(s As String) As String
change = AscW(s)
If change < 0 Then
change = change + 65536
End If
End Function
Private Function change2(s As String) As String
change2 = Asc(s)
End Function
Private Sub Text1_Change()
For i = 1 To Len(Text1.Text)
s = s & change(Mid(Text1.Text, i, 1)) & " "
Next
Text2.Text = s
s = ""
For i = 1 To Len(Text1.Text)
s = s & change2(Mid(Text1.Text, i, 1)) & " "
Next
Text3.Text = s
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -