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

📄 form1.frm

📁 关于VB开发的教程
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00808080&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "停车检查"
   ClientHeight    =   4440
   ClientLeft      =   2910
   ClientTop       =   2445
   ClientWidth     =   6150
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4440
   ScaleWidth      =   6150
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command1 
      BackColor       =   &H00808080&
      Caption         =   "Command1"
      Height          =   495
      Left            =   960
      TabIndex        =   5
      Top             =   1200
      Visible         =   0   'False
      Width           =   3135
   End
   Begin VB.PictureBox Picture3 
      AutoSize        =   -1  'True
      BackColor       =   &H00808080&
      BorderStyle     =   0  'None
      Height          =   480
      Left            =   2280
      Picture         =   "Form1.frx":0442
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   4
      Top             =   2760
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture2 
      AutoSize        =   -1  'True
      BackColor       =   &H00808080&
      BorderStyle     =   0  'None
      Height          =   480
      Left            =   3720
      Picture         =   "Form1.frx":0884
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   3
      Top             =   2760
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture1 
      AutoSize        =   -1  'True
      BackColor       =   &H00808080&
      BorderStyle     =   0  'None
      Height          =   480
      Left            =   3000
      Picture         =   "Form1.frx":0CC6
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   2
      Top             =   2760
      Width           =   480
   End
   Begin VB.TextBox Text1 
      Height          =   1695
      Left            =   1200
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   960
      Width           =   3855
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackColor       =   &H00808080&
      Caption         =   "你必须在30字之内完成你理由的申诉,否则将受到罚款!"
      ForeColor       =   &H00FF0000&
      Height          =   195
      Left            =   960
      TabIndex        =   6
      Top             =   3480
      Width           =   4500
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00808080&
      Caption         =   "警官,我超速是有原因的,请听我说:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   300
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   5220
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Level As Integer

Private Sub Command1_Click()
 Unload Me
End Sub

Private Sub Form_Load()
'把Command1放在水平的中央
Command1.Top = Label2.Top + 200
Command1.Left = (Form1.Width - Command1.Width) / 2
'重叠三个图片框
Picture2.Left = Picture1.Left
Picture2.Top = Picture1.Top
Picture3.Left = Picture1.Left
Picture3.Top = Picture1.Top
End Sub

Private Sub Text1_Change()
Dim StrLength As Integer
Dim RandomNum As Single
Dim Str1 As String
Dim a As String
Dim i, Temp
StrLength = 0
a = Text1.Text
For i = 1 To Len(a)
 Temp = Asc(Mid$(a, i, 1))
 If Temp > 255 Or Temp < 0 Then
   StrLength = StrLength + 2
 Else
   StrLength = StrLength + 1
 End If
Next i
 
 StrLength = StrLength / 2
 Select Case StrLength
   Case 0 To 9
     Picture1.Visible = True
     Picture2.Visible = False
     Picture3.Visible = False
     Label2.Caption = "慢慢说。你还有" & Str(30 - StrLength) & "个字可以说"
     Level = 1
   Case 10 To 19
     If Level = 1 Then
       RandomNum = Rnd * 10
       If RandomNum <= 10 And RandomNum > 9 Then
         Text1.Enabled = False
         Label2.Caption = "很抱歉这是个误会……"
         Command1.Visible = True
         Command1.Caption = "您可以离开了"
       End If
       Level = 2
     Else
     Picture1.Visible = False
     Picture2.Visible = True
     Picture3.Visible = False
     Str1 = "怎么还没说完!"
     Label2.Caption = Str1 & "你还有" & Str(30 - StrLength) & "个字可以说"
     End If
   Case 20 To 29
     If Level = 2 Then
       RandomNum = Rnd * 10
       If RandomNum <= 10 And RandomNum > 9 Then
         Text1.Enabled = False
         Label2.Caption = "很抱歉这是个误会……"
         Command1.Visible = True
         Command1.Caption = "您可以离开了"
       End If
       Level = 3
     Else
       Picture1.Visible = False
       Picture2.Visible = False
       Picture3.Visible = True
       Str1 = "我已经不耐烦了!"
       Label2.Caption = Str1 & "你还有" & Str(30 - StrLength) & "个字可以说"
     End If
   Case Else
     Text1.Enabled = False
     Label2.Caption = "你已经没有机会了!"
     Command1.Visible = True
     Command1.Caption = "交钱吧,肇事犯!"
 End Select
End Sub

⌨️ 快捷键说明

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