Question Date help

standard

New member
Joined
Sep 3, 2010
Messages
3
Programming Experience
Beginner
how to show

MsgBox("it's new day again")

if the date change...?
 
You can get current day value from Date.Now.Day property, store it in a variable and use a Timer to periodically compare current Day with your stored value.
 
tell me the code r what can i use datapicker or timer

i would like greetings every day when the software first launch the messages show

MsgBox("it's new day again good morning sir.!")

if the date change...? can you give me sample code sir ..
 
To begin, create a date variable in My.Settings. Next, check the box labeled "Save My.Settings on Shutdown". Now, you won't lose the date each time the program ends.

Put the following code in the Form_Load event:
VB.NET:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'capture today's date
        Dim ggDay As Date = Date.Now.Date

        'I named the My.Settings variable "todayDate" but you can name it anything you wish.
        If (ggDay > My.Settings.todayDate) Then
            My.Settings.todayDate = Date.Now.Date
            MsgBox("it's new day again good morning sir.!")
        End If

End Sub
 
Back
Top