|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
what method to use to add 1 day to a date (hotel reservation for one night by clicking on calender)Private Sub dtmMonthCalendar1_MouseLeave(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles dtmMonthCalendar1.MouseLeave mdatArrivalDate = dtmMonthCalendar1.SelectionStart txtArrivalDate.Text = mdatArrivalDate If dtmMonthCalendar1.CanSelect Then txtDepartureDate.Text = dtmMonthCalendar1.SelectionEnd txtNightStayed.Text = (dtmMonthCalendar1.SelectionEnd _ - dtmMonthCalendar1.SelectionStart).TotalDays Else txtDepartureDate.Text = ???? txtNightStayed.Text = "1" End If ' mshrNightStayed = Val(txtNightStayed.Text) dtmMonthCalendar1.Hide() End Sub Amanda,
By instance mdatArrivalDate = mdatArrivalDate.AddDays(1) http://msdn2.microsoft.com/en-us/library/system.datetime.adddays.aspx I hope this helps, Cor Show quoteHide quote "Amanda" <amanda772***@yahoo.com> schreef in bericht news:1160456789.020507.168180@m7g2000cwm.googlegroups.com... > here is my code; see ???? > > > Private Sub dtmMonthCalendar1_MouseLeave(ByVal sender As Object, _ > ByVal e As System.EventArgs) Handles dtmMonthCalendar1.MouseLeave > > mdatArrivalDate = dtmMonthCalendar1.SelectionStart > txtArrivalDate.Text = mdatArrivalDate > > If dtmMonthCalendar1.CanSelect Then > txtDepartureDate.Text = dtmMonthCalendar1.SelectionEnd > txtNightStayed.Text = (dtmMonthCalendar1.SelectionEnd _ > - dtmMonthCalendar1.SelectionStart).TotalDays > Else > txtDepartureDate.Text = ???? > txtNightStayed.Text = "1" > End If ' > > mshrNightStayed = Val(txtNightStayed.Text) > dtmMonthCalendar1.Hide() > > End Sub > Cor Ligthert [MVP] wrote:
> Amanda, Yeah, I needed to assign to a date variable and then call AddDays. I> > By instance > mdatArrivalDate = mdatArrivalDate.AddDays(1) was hoping that I could just do it diretcly to calender.SelectionEnd. Thanks Show quoteHide quote > > http://msdn2.microsoft.com/en-us/library/system.datetime.adddays.aspx > > I hope this helps, > > Cor > > "Amanda" <amanda772***@yahoo.com> schreef in bericht > news:1160456789.020507.168180@m7g2000cwm.googlegroups.com... > > here is my code; see ???? > > > > > > Private Sub dtmMonthCalendar1_MouseLeave(ByVal sender As Object, _ > > ByVal e As System.EventArgs) Handles dtmMonthCalendar1.MouseLeave > > > > mdatArrivalDate = dtmMonthCalendar1.SelectionStart > > txtArrivalDate.Text = mdatArrivalDate > > > > If dtmMonthCalendar1.CanSelect Then > > txtDepartureDate.Text = dtmMonthCalendar1.SelectionEnd > > txtNightStayed.Text = (dtmMonthCalendar1.SelectionEnd _ > > - dtmMonthCalendar1.SelectionStart).TotalDays > > Else > > txtDepartureDate.Text = ???? > > txtNightStayed.Text = "1" > > End If ' > > > > mshrNightStayed = Val(txtNightStayed.Text) > > dtmMonthCalendar1.Hide() > > > > End Sub > >
class library
Locating Windows Application Installation Keys Reflection - Delay Signing Error - HELP Something I don't quite understand about "file in use by another process" exceptions..... Detect WiFi Networks Adding rows to a data table: Rows do not show up Variable precision Saving color changes for next login Round to 2 decimals in a Datalist How to send output ticket Printer(VB005) |
|||||||||||||||||||||||