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

📄 form1.frm

📁 delphi 编写的高精度定时器控件
💻 FRM
字号:
VERSION 5.00
Object = "{F7AFC977-DBA3-4EF9-8650-64E50ED124E7}#1.0#0"; "MyTimerPrj.ocx"
Begin VB.Form Form1 
   Caption         =   "高精度定时器控件测试"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin MyTimerPrj.MyTimer MyTimer1 
      Left            =   390
      Top             =   930
      Enabled         =   0   'False
      Interval        =   10
      Resolution      =   10
   End
   Begin VB.Timer Timer1 
      Left            =   3930
      Top             =   930
   End
   Begin VB.CommandButton Command2 
      Caption         =   "结束"
      Height          =   585
      Left            =   2370
      TabIndex        =   2
      Top             =   2070
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始"
      Height          =   585
      Left            =   420
      TabIndex        =   0
      Top             =   2070
      Width           =   1635
   End
   Begin VB.Label Label2 
      Caption         =   "计数:"
      Height          =   315
      Left            =   750
      TabIndex        =   3
      Top             =   330
      Width           =   1035
   End
   Begin VB.Label Label1 
      Caption         =   "0"
      Height          =   315
      Left            =   2220
      TabIndex        =   1
      Top             =   330
      Width           =   1305
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim count1 As Integer
Private Sub Command1_Click()
MyTimer1.Enabled = True
End Sub

Private Sub Command2_Click()
MyTimer1.Enabled = False
End Sub





Private Sub Form_Load()
count1 = 0
End Sub

Private Sub Form_Unload(Cancel As Integer)
MyTimer1.Enabled = False
End Sub

Private Sub MyTimer1_OnTimer()
If count1 > 30000 Then count1 = 0
 count1 = count1 + 1
 
 Label1.Caption = count1
End Sub

⌨️ 快捷键说明

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