VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "回文数"
   ClientHeight    =   2550
   ClientLeft      =   1095
   ClientTop       =   1515
   ClientWidth     =   6720
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2550
   ScaleWidth      =   6720
   Begin VB.PictureBox Picture1 
      Height          =   1815
      Left            =   1800
      ScaleHeight     =   1755
      ScaleWidth      =   2715
      TabIndex        =   2
      Top             =   600
      Width           =   2775
   End
   Begin VB.TextBox Text1 
      Height          =   735
      Left            =   360
      TabIndex        =   1
      Top             =   960
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "显示结果"
      Height          =   375
      Left            =   1800
      TabIndex        =   3
      Top             =   120
      Width           =   1815
   End
   Begin VB.Label Label1 
      Caption         =   "输入数"
      Height          =   495
      Left            =   360
      TabIndex        =   0
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
     If Not IsNumeric(Text1) Then
       MsgBox "输入非数字串，重新输入"
       Text1.Text = ""
       Text1.SetFocus
     Else
       If IsH(Text1) Then
         Picture1.Print Text1; " ★ "
       Else
         Picture1.Print Text1
       End If
       Text1 = ""
     End If
   End If
End Sub
Function IsH(ss As String) As Boolean
    Dim i%, Ls%
    IsH = True
    ss = Trim(ss)
    Ls = Len(ss)
    For i = 1 To Ls \ 2
      If Mid(ss, i, 1) <> Mid(ss, Ls + 1 - i, 1) Then
        IsH = False
        Exit Function
      End If
    Next i
End Function
