VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "大小写字母转换"
   ClientHeight    =   2385
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2385
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "结束"
      Height          =   495
      Left            =   3960
      TabIndex        =   5
      Top             =   1200
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "清屏"
      Height          =   495
      Left            =   3960
      TabIndex        =   4
      Top             =   480
      Width           =   615
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   600
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   1
      Top             =   1320
      Width           =   3255
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   600
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   0
      Top             =   240
      Width           =   3255
   End
   Begin VB.Label label2 
      Caption         =   "转换"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   120
      TabIndex        =   3
      Top             =   1440
      Width           =   255
      WordWrap        =   -1  'True
   End
   Begin VB.Label label1 
      Caption         =   "输入字符串"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   120
      TabIndex        =   2
      Top             =   240
      Width           =   255
      WordWrap        =   -1  'True
   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 Sub Text1_KeyPress(KeyAscii As Integer)
  Dim aa As String * 1
  Dim Length As Integer      ' Length存放文本框中字符串的长度
  Length = Len(Text2.Text)   ' 求Text2中字符串长度
  aa = Chr$(KeyAscii)        ' 将ASCII码转换成字符
        Select Case aa
    Case "A" To "Z"          '大写转换成小写
      aa = Chr$(KeyAscii + 32)
    Case "a" To "z"          '小写转换成大写
      aa = Chr$(KeyAscii - 32)
    Case " "
    
    Case Else
      aa = "*"
  End Select
      ' 将转换文本框已有的内容与刚输入并转换的字符连接
     Text2.Text = Text2.Text & aa
End Sub
Private Sub Command1_Click()
   Text1.Text = ""
   Text2.Text = ""
End Sub

Private Sub Command2_Click()
   End
End Sub
