JAI MATADI ..
hello . .i want to get number of days selected in monthcalenders (monthcalender1 and monthcalender2) from VB.NET (Windows Application ) in VISUAL STUDIO 2010 ..
here is a query what i want to do ..
-----------------------------------------------------
i have one Button called as "See Days" id "Button1"
i have one TextBox id "TextBox1"
and i have two MonthCalenders id's are "MonthCalender1" and "MonthCalender2"
"Calender1" for DateIn and
"Calender2" for DateOut
-----------------------------------------------------
now what i want is when the user clicks on the Button after selecting "DateIn" and "DateOut" the DateIn he/she will be able to see how many days he/she has selected ..
how can i do this ..
please help me .. and let me know ..
thank you in advance ..
i have tried this code below which is not working properly ..
--------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If MonthCalendar1.SelectionRange.Start > MonthCalendar2.SelectionRange.Start Then
MsgBox("The DateIn can not be more then Dateout", MsgBoxStyle.Critical, "Invalid DateIn and DateOut")
Else
Dim range1, range2 As SelectionRange
range1 = MonthCalendar1.SelectionRange
range2 = MonthCalendar2.SelectionRange
Dim a As Integer
a = range1.End.Subtract(range1.End).Days + range2.End.Subtract(range2.End).Days
TextBox1.Text = a
End If
End Sub
--------------------------------------------------------
please provide me the exact code please if possible ..
thanks a lott ..
hello . .i want to get number of days selected in monthcalenders (monthcalender1 and monthcalender2) from VB.NET (Windows Application ) in VISUAL STUDIO 2010 ..
here is a query what i want to do ..
-----------------------------------------------------
i have one Button called as "See Days" id "Button1"
i have one TextBox id "TextBox1"
and i have two MonthCalenders id's are "MonthCalender1" and "MonthCalender2"
"Calender1" for DateIn and
"Calender2" for DateOut
-----------------------------------------------------
now what i want is when the user clicks on the Button after selecting "DateIn" and "DateOut" the DateIn he/she will be able to see how many days he/she has selected ..
how can i do this ..
please help me .. and let me know ..
thank you in advance ..
i have tried this code below which is not working properly ..
--------------------------------------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If MonthCalendar1.SelectionRange.Start > MonthCalendar2.SelectionRange.Start Then
MsgBox("The DateIn can not be more then Dateout", MsgBoxStyle.Critical, "Invalid DateIn and DateOut")
Else
Dim range1, range2 As SelectionRange
range1 = MonthCalendar1.SelectionRange
range2 = MonthCalendar2.SelectionRange
Dim a As Integer
a = range1.End.Subtract(range1.End).Days + range2.End.Subtract(range2.End).Days
TextBox1.Text = a
End If
End Sub
--------------------------------------------------------
please provide me the exact code please if possible ..
thanks a lott ..