Delay Properties Reference
📋 Property List
| Property | Type | Read/Write | Description |
|---|---|---|---|
Mode | DelayMode | Read-only | Current working mode |
IsActive | Boolean | Read-only | Whether delay is in progress |
IsCancelled | Boolean | Read-only | Whether cancelled (sync mode) |
DelayMs | Long | Read-only | Delay milliseconds |
🔄 Mode Property
Description
Gets the current working mode.
Syntax
vb
Public Property Get Mode() As DelayModeReturn Value
| Value | Constant | Description |
|---|---|---|
| 0 | dmEvent | Event-triggered mode |
| 1 | dmCallback | Callback function mode |
| 2 | dmSync | Synchronous wait mode |
Example
vb
Private Sub CheckMode()
Select Case Delay.Mode
Case dmEvent
Debug.Print "Event mode"
Case dmCallback
Debug.Print "Callback mode"
Case dmSync
Debug.Print "Sync mode"
End Select
End Sub✅ IsActive Property
Description
Gets whether a delay is currently in progress.
Syntax
vb
Public Property Get IsActive() As BooleanReturn Value
True- Delay is in progressFalse- Delay not started or already finished
Example
vb
Private Sub StartDelay()
If Delay.IsActive Then
Debug.Print "Delay already in progress"
Exit Sub
End If
Delay.CountDown 3000
End Sub🚫 IsCancelled Property
Description
Gets whether cancelled in synchronous mode. Only valid in sync mode.
Syntax
vb
Public Property Get IsCancelled() As BooleanReturn Value
True- Delay was cancelledFalse- Delay completed normally
Example
vb
Private Sub TestSyncWithCancel()
Dim Delay As New cDelay
' Start delay, can be cancelled via Cancel method
Delay.Sync().CountDown 10000
' Check if cancelled
If Delay.IsCancelled Then
Debug.Print "User cancelled operation"
Else
Debug.Print "Delay completed normally"
End If
End Sub⏱️ DelayMs Property
Description
Gets the configured delay milliseconds.
Syntax
vb
Public Property Get DelayMs() As LongExample
vb
Private Sub ShowDelayInfo()
Debug.Print "Delay setting: " & Delay.DelayMs & " milliseconds"
End Sub📌 Property Usage Scenarios Summary
Status Check
vb
If Delay.IsActive Then
MsgBox "Please wait for current delay to finish"
Else
Delay.CountDown 3000
End IfSync Mode Result Check
vb
Delay.Sync().CountDown 5000
If Delay.IsCancelled Then
' User cancelled operation
Exit Sub
End If
' Continue with subsequent operationsLast Updated: 2026-05-17