⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 本文件包含200个visual baisc实例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00FF8080&
   Caption         =   "获得汉字的拼音简码"
   ClientHeight    =   3300
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6330
   LinkTopic       =   "Form1"
   ScaleHeight     =   3300
   ScaleWidth      =   6330
   StartUpPosition =   1  '所有者中心
   Begin VB.OptionButton Option1 
      BackColor       =   &H00FF8080&
      Caption         =   "自动获得字母"
      Height          =   270
      Left            =   195
      TabIndex        =   5
      Top             =   180
      Width           =   2385
   End
   Begin VB.CommandButton Command1 
      Caption         =   "显示字母"
      Height          =   480
      Left            =   1440
      TabIndex        =   4
      Top             =   2550
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   480
      Left            =   3270
      TabIndex        =   1
      Top             =   2550
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   1050
      TabIndex        =   0
      Text            =   "吉林省长春市"
      Top             =   885
      Width           =   4215
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "显示:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1050
      TabIndex        =   3
      Top             =   1635
      Width           =   930
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   1815
      TabIndex        =   2
      Top             =   1635
      Width           =   3480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function py(mystr As String) As String
  If Asc(mystr) < 0 Then
    If Asc(Left(mystr, 1)) < Asc("啊") Then
       py = "0"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("啊") And Asc(Left(mystr, 1)) < Asc("芭") Then
       py = "A"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("芭") And Asc(Left(mystr, 1)) < Asc("擦") Then
       py = "B"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("擦") And Asc(Left(mystr, 1)) < Asc("搭") Then
       py = "C"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("搭") And Asc(Left(mystr, 1)) < Asc("蛾") Then
       py = "D"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("蛾") And Asc(Left(mystr, 1)) < Asc("发") Then
       py = "E"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("发") And Asc(Left(mystr, 1)) < Asc("噶") Then
       py = "F"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("噶") And Asc(Left(mystr, 1)) < Asc("哈") Then
       py = "G"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("哈") And Asc(Left(mystr, 1)) < Asc("击") Then
       py = "H"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("击") And Asc(Left(mystr, 1)) < Asc("喀") Then
       py = "J"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("喀") And Asc(Left(mystr, 1)) < Asc("垃") Then
       py = "K"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("垃") And Asc(Left(mystr, 1)) < Asc("妈") Then
       py = "L"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("妈") And Asc(Left(mystr, 1)) < Asc("拿") Then
       py = "M"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("拿") And Asc(Left(mystr, 1)) < Asc("哦") Then
       py = "N"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("哦") And Asc(Left(mystr, 1)) < Asc("啪") Then
       py = "O"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("啪") And Asc(Left(mystr, 1)) < Asc("期") Then
       py = "P"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("期") And Asc(Left(mystr, 1)) < Asc("然") Then
       py = "Q"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("然") And Asc(Left(mystr, 1)) < Asc("撒") Then
       py = "R"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("撒") And Asc(Left(mystr, 1)) < Asc("塌") Then
       py = "S"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("塌") And Asc(Left(mystr, 1)) < Asc("挖") Then
       py = "T"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("挖") And Asc(Left(mystr, 1)) < Asc("昔") Then
       py = "W"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("昔") And Asc(Left(mystr, 1)) < Asc("压") Then
       py = "X"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("压") And Asc(Left(mystr, 1)) < Asc("匝") Then
       py = "Y"
       Exit Function
    End If
    If Asc(Left(mystr, 1)) >= Asc("匝") Then
       py = "Z"
       Exit Function
    End If
  Else
    If UCase(mystr) <= "Z" And UCase(mystr) >= "A" Then
       py = UCase(Left(mystr, 1))
      Else
       py = mystr
    End If
  End If
End Function

Private Sub Text1_Change()
  If Option1.Value = True Then
     Label1.Caption = ""
     Dim a As Integer
     a = Len(Text1.Text)
     For i = 1 To a
         Label1.Caption = Label1.Caption & py(Mid(Text1.Text, i, 1))
     Next i
  End If
End Sub

Private Sub Command1_Click()
  Dim a As Integer
  Label1.Caption = ""
  a = Len(Text1.Text)
  For i = 1 To a
      Label1.Caption = Label1.Caption & py(Mid(Text1.Text, i, 1))
  Next i
End Sub

Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -