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

📄 frmtick.frm

📁 Visual Basic 6 大学教程的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmTicker 
   Caption         =   "Demonstrating Property procedures"
   ClientHeight    =   3825
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3825
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtSecond 
      Height          =   375
      Left            =   3360
      TabIndex        =   4
      Text            =   "0"
      Top             =   1320
      Width           =   1215
   End
   Begin VB.TextBox txtMinute 
      Height          =   375
      Left            =   3360
      TabIndex        =   3
      Text            =   "0"
      Top             =   720
      Width           =   1215
   End
   Begin VB.TextBox txtHour 
      Height          =   375
      Left            =   3360
      TabIndex        =   2
      Text            =   "0"
      Top             =   120
      Width           =   1215
   End
   Begin VB.CommandButton cmdEnter 
      Caption         =   "Enter"
      Height          =   495
      Left            =   1680
      TabIndex        =   1
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "Add 1 Second"
      Height          =   495
      Left            =   1560
      TabIndex        =   0
      Top             =   3240
      Width           =   1455
   End
   Begin VB.Label lblDisplay 
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   120
      TabIndex        =   8
      Top             =   2640
      Width           =   4455
   End
   Begin VB.Label lblSecond 
      Caption         =   "Enter the second (0 - 59):"
      Height          =   255
      Left            =   240
      TabIndex        =   7
      Top             =   1440
      Width           =   3015
   End
   Begin VB.Label lblMinute 
      Caption         =   "Enter the minute (0 - 59):"
      Height          =   255
      Left            =   240
      TabIndex        =   6
      Top             =   840
      Width           =   3015
   End
   Begin VB.Label lblHour 
      Caption         =   "Enter the hour (0 - 23):"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   240
      Width           =   3015
   End
End
Attribute VB_Name = "frmTicker"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Form module that exercises CTime2
Option Explicit

Private mTime As New CTime2

Private Sub Form_Load()
   Call mTime.SetTime(txtHour.Text, txtMinute.Text, _
                      txtSecond.Text)
   Call UpdateDisplay
End Sub

Private Sub cmdEnter_Click()
   mTime.Hour = txtHour.Text
   mTime.Minute = txtMinute.Text
   mTime.Second = txtSecond.Text
   Call UpdateDisplay
End Sub

Private Sub cmdAdd_Click()
   mTime.Second = (mTime.Second + 1) Mod 60
   
   If mTime.Second = 0 Then
      mTime.Minute = (mTime.Minute + 1) Mod 60
      
      If mTime.Minute = 0 Then
         mTime.Hour = (mTime.Hour + 1) Mod 24
      End If
      
   End If
    
   Call UpdateDisplay
End Sub

Private Sub UpdateDisplay()
   lblDisplay.Caption = Space$(12) & "Standard: " & _
                        mTime.ToStandardTime() & _
                        "    Universal: " & _
                        mTime.ToUniversalTime()
End Sub

⌨️ 快捷键说明

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