VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "字符缩放"
   ClientHeight    =   2370
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4140
   LinkTopic       =   "Form1"
   ScaleHeight     =   2370
   ScaleWidth      =   4140
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1815
      Left            =   240
      MultiLine       =   -1  'True
      TabIndex        =   3
      Text            =   "sy01-07.frx":0000
      Top             =   480
      Width           =   2655
   End
   Begin VB.CommandButton Command3 
      Caption         =   "还原"
      Height          =   495
      Left            =   3120
      TabIndex        =   2
      Top             =   1680
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "缩小"
      Height          =   495
      Left            =   3120
      TabIndex        =   1
      Top             =   960
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "放大"
      Height          =   495
      Left            =   3120
      TabIndex        =   0
      Top             =   240
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "输入文本"
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   1455
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim r As Integer                        ' 存放缩放的倍数
Dim size As Integer                     ' 保存文本框原字号，供"还原"按钮使用
Private Sub Form_Load()
    Randomize                           ' 初始化随机数生成器
    size = Text1.FontSize               ' 获取文本框原字号
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then           ' 当在文本框按Enter键，表示输入结束
      Text1 = Trim(Text1)               ' Trim为去除文本框两边空格函数
      Text1 = UCase(Text1)          ' UCase把字母全部转换成大写字母函数
    End If
End Sub
Private Sub Command1_Click()            ' "放大"按钮
   r = Int(Rnd * 3 + 1)
   Text1.FontSize = Text1.FontSize * r  ' 放大1~3倍
   Command1.Enabled = False         ' 放大一次，"放大"按钮无效
   Command2.Enabled = True          '"缩小"按钮有效
End Sub
Private Sub Command2_Click()            ' "缩小"按钮
   r = Int(Rnd * 3 + 1)
   Text1.FontSize = Text1.FontSize \ r ' 缩小1~3倍
   Command2.Enabled = False         ' 缩小一次，"缩小"按钮无效
   Command1.Enabled = True          '"放大"按钮有效
End Sub
Private Sub Command3_Click()            ' "还原"按钮
   Text1.FontSize = size
   Command1.Enabled = True        '"放大"按钮有效
   Command2.Enabled = True          '"缩小"按钮有效
End Sub
