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...?:bigyello:
Printable View
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...?:bigyello:
i would like every morning please can some one teach me.. :wave::wave::wave:
can i use timer or datepicker?
Stop and look up what the Timer and a DateTimePicker controls do. Then you'll realize that neither of them are for what you want. Unless the program runs all night, then you might make use of a timer, but for the times when it's ran for the first time that day, neither the DateTimePicker nor the Timer would be used.
thats the question...
how to compare day yesterday and day now..
if software runs today and the date was changed the software automatic give message
MsgBox("it's new day again.!")
how to do that...
1. Create a field in a table and store a date
2. when app starts compare current date with date field.
3. If different, show message. then replace date field with current date.
ok number
3. is my problem..
Code:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = Format(Date.Today)
Label2.Text = DateAdd(DateInterval.Day, -1, (Date.Today))
If Label1.Text > Label2.Text Then
MsgBox("GOOD DAY!")
End If
End Sub
3.How to replace
DateAdd(DateInterval.Day, -1, (Date.Today)) to DateAdd(DateInterval.Day, 0, (Date.Today))
Ok, first thing you need to do is be sure to save the current date when the app exits, have you done that?
I would recommend using the Settings for that, in the project properties I would create a new variable of type Date. Then in the main form's FormClosing event, set the variable to DateTime.Today.
Then in the main form's Load event I would check that settings variable for not equal today (use the Not DateTime.Today.Date.Equals() ). Then inside that If block, it's only a matter of determining if it's morning, noon, afternoon or evening (or however precise you want it to be) here's an example of AM/PM:Now it's just a matter of you figuring out exactly how you want that to workCode:If DateTime.Now.Hour < 12 Then
'AM
Else '12 to 23 is afternoon/evening
'PM
End If
OK SOLVED sir thanks...JuggaloBrotha