Skip to content

Delay Properties Reference

📋 Property List

PropertyTypeRead/WriteDescription
ModeDelayModeRead-onlyCurrent working mode
IsActiveBooleanRead-onlyWhether delay is in progress
IsCancelledBooleanRead-onlyWhether cancelled (sync mode)
DelayMsLongRead-onlyDelay milliseconds

🔄 Mode Property

Description

Gets the current working mode.

Syntax

vb
Public Property Get Mode() As DelayMode

Return Value

ValueConstantDescription
0dmEventEvent-triggered mode
1dmCallbackCallback function mode
2dmSyncSynchronous 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 Boolean

Return Value

  • True - Delay is in progress
  • False - 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 Boolean

Return Value

  • True - Delay was cancelled
  • False - 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 Long

Example

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 If

Sync Mode Result Check

vb
Delay.Sync().CountDown 5000

If Delay.IsCancelled Then
    ' User cancelled operation
    Exit Sub
End If

' Continue with subsequent operations

Last Updated: 2026-05-17

VB6 and LOGO copyright of Microsoft Corporation