📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "表单"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 855
Left = 120
MultiLine = -1 'True
TabIndex = 2
Text = "Form1.frx":0000
Top = 240
Width = 4335
End
Begin VB.CommandButton Command2
Caption = "简体"
Height = 495
Left = 3000
TabIndex = 1
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command1
Caption = " 繁体"
Height = 495
Left = 1800
TabIndex = 0
Top = 1320
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function LCMapString Lib "kernel32" Alias _
"LCMapStringA" (ByVal Locale As Long, ByVal dwMapFlags As _
Long, ByVal lpSrcStr As String, ByVal cchSrc As Long, _
ByVal lpDestStr As String, ByVal cchDest As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" _
(ByVal lpString As String) As Long
Dim STf As String, 繁体字符串
Dim STj As String, 简体字符串
Dim STlen As Long, 待转换字串长度
Private Sub Command1_Click() 'Gb码简体转繁体
STj = Text1.Text
STlen = lstrlen(STj)
STf = Space(STlen)
LCMapString &H804, &H4000000, STj, STlen, STf, STlen
'Debug.Print STf
Text1.Text = STf
Text1.Refresh
STj = Command1.Caption
STlen = lstrlen(STj)
STf = Space(STlen)
LCMapString &H804, &H4000000, STj, STlen, STf, STlen
Command1.Caption = STf
STj = Command2.Caption
STlen = lstrlen(STj)
STf = Space(STlen)
LCMapString &H804, &H4000000, STj, STlen, STf, STlen
Command2.Caption = STf
STj = Form1.Caption
STlen = lstrlen(STj)
STf = Space(STlen)
LCMapString &H804, &H4000000, STj, STlen, STf, STlen
Form1.Caption = STf
End Sub
Private Sub Command2_Click() 'Gb码繁体转简体
STf = Text1.Text
STlen = lstrlen(STf)
STj = Space(STlen)
LCMapString &H804, &H2000000, STf, STlen, STj, STlen
'Debug.Print STj
Text1.Text = STj
Text1.Refresh
STf = Command1.Caption
STlen = lstrlen(STf)
STj = Space(STlen)
LCMapString &H804, &H2000000, STf, STlen, STj, STlen
Command1.Caption = STj
STf = Command2.Caption
STlen = lstrlen(STf)
STj = Space(STlen)
LCMapString &H804, &H2000000, STf, STlen, STj, STlen
Command2.Caption = STj
STf = Form1.Caption
STlen = lstrlen(STf)
STj = Space(STlen)
LCMapString &H804, &H2000000, STf, STlen, STj, STlen
Form1.Caption = STj
End Sub
Private Sub Form_Load()
Command1.Caption = "转成繁体"
Command2.Caption = "转成简体"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -