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

📄 settime.frm

📁 一个用VB编写的关于拼图的游戏
💻 FRM
字号:
VERSION 5.00
Begin VB.Form SetTime 
   Caption         =   "SetTime"
   ClientHeight    =   840
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   3480
   Icon            =   "SetTime.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   840
   ScaleWidth      =   3480
   Begin VB.CommandButton Co2 
      Cancel          =   -1  'True
      Caption         =   "Cance"
      Height          =   250
      Left            =   2520
      TabIndex        =   4
      Top             =   480
      Width           =   730
   End
   Begin VB.CommandButton Co1 
      Caption         =   "Ok"
      Height          =   250
      Left            =   2520
      TabIndex        =   3
      Top             =   120
      Width           =   730
   End
   Begin VB.TextBox Text2 
      Height          =   260
      Left            =   1320
      TabIndex        =   1
      Top             =   480
      Width           =   260
   End
   Begin VB.TextBox Text1 
      Height          =   260
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   260
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   0
      Picture         =   "SetTime.frx":030A
      Top             =   120
      Width           =   480
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   " You can set gametime."
      Height          =   180
      Left            =   480
      TabIndex        =   5
      Top             =   180
      Width           =   1980
   End
   Begin VB.Label Label1 
      Caption         =   "Min      Sec"
      Height          =   255
      Left            =   840
      TabIndex        =   2
      Top             =   555
      Width           =   1095
   End
End
Attribute VB_Name = "SetTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public CA As Integer
Private Sub Co1_Click()
On Error GoTo er
 a = Int(Str(Text1.Text))
 b = Int(Str(Text2.Text))
 If a = "0" And b = 0 Then GoTo er:
 If a >= 0 And a < 60 Then
   Text1.Text = a
 End If
 If b >= 0 And b < 60 Then
   Text2.Text = b
 End If
 If PICG.Dif = 0 Then
   PICG.GTiM = 1: PICG.GTiS = 30
 Else
   PICG.GTiM = 3: PICG.GTiS = 0
 End If
 If a = PICG.GTiM And b = PICG.GTiS Then
   PICG.Hig = 0
 Else
   PICG.Hig = 1
 End If
 PICG.GTiM = a: PICG.GTiS = b
 Unload Me
 PICG.Show
 Exit Sub
er:
 msg = MsgBox("Invalid Time", vbOKOnly + vbCritical, "No Set")
 Text1.SetFocus
End Sub

Private Sub Co2_Click()
 Unload Me
 PICG.Show
End Sub
Private Sub Form_Load()
 Me.Left = PICG.Left + 500
 Me.Top = PICG.Top + 1500
 CA = PICG.Mov
 PICG.Mov = 0                     '停止计时
 Text1.Text = PICG.GTiM
 Text2.Text = PICG.GTiS
End Sub

Private Sub Form_Unload(Cancel As Integer)
  PICG.Mov = CA
End Sub

Private Sub Text1_GotFocus()
  Text1.SelStart = 0
  Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
   Text2.SetFocus
  End If
End Sub
Private Sub Text2_GotFocus()
  Text2.SelStart = 0
  Text2.SelLength = Len(Text2.Text)
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
   Co1 = True
 End If
End Sub

⌨️ 快捷键说明

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