VB.Net Timer

Thisara Udayanga 21 Reputation points
2022-08-06T10:15:39.96+00:00

Hi,

I want to prompt a message box according to time. Please help me.

Eg: I want to Prompt a msg "Now 3 O'clock" at 3 PM.

Developer technologies VB
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,681 Reputation points
    2022-08-06T11:17:38.9+00:00

    For example :

    Private WithEvents Timer1 As New Timer With {.Interval = 1000, .Enabled = True}  
    
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick  
        If DateTime.Now.Hour = 15 And DateTime.Now.Minute = 0 And DateTime.Now.Second = 0 Then  
            MessageBox.Show("Now 3 O'clock", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)  
        End If  
    End Sub
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.