0

I want to display date and time on top of the form where normlly written form1 forms name

i want to display date in formate of for example 23 August 2010

and time in this formate 12:33:20AM

Please please help.

3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by krunal1089
0

where should i write this line of code to get date and time on top of the form?

0

Thanks its woking but now it replaces form name how can i display both the form name and date and time.

Please please help thanks for your kind support and help.

0

How is it adding the date and time to your Form's Title? Me.Text=""?

Have you tried adding the name of your Form's title first, followed by & and the code I have provided?

0
Public Class Form1

    Private WithEvents myTimer As New Timer With {.Interval = 1000, .Enabled = True}

    Private Sub myTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles myTimer.Tick
        Me.Text = "Cool little Title - " & Date.Now.ToLongDateString & " - " & TimeOfDay
    End Sub
End Class
0

see 1st take Timer from toolbox & then write blow mention code & date format u can change as per your requirement ok if u still have any doubt u can ask me ok

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Text = "title wich you want write here " & Now.ToUniversalTime
End Sub
End Class

I want to display date and time on top of the form where normlly written form1 forms name

i want to display date in formate of for example 23 August 2010

and time in this formate 12:33:20AM

Please please help.

Edited by krunal1089: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.