Colin Evans Active Member Licensed User Longtime User May 13, 2021 #1 Hi, I'm sure this is an easy one if you know how I'm using Datepicker in the designer, and I want to have two buttons that allow me to go forward or backwards one day, i.e next and previous But I can't find a way to navigate I also have a today button to return me back to today which works but I can't figure the next previous Code: Copy Private Sub btnToday_Action Log("btnToday") DateTime.DateFormat="dd-MM-yyyy" Dim Today As String = DateTime.Date(DateTime.Now) Log("Today " & Today) DatePicker1.DateFormat = "dd-MM-yyyy" DatePicker1.DateTicks = TodayTick End Sub [/code}
Hi, I'm sure this is an easy one if you know how I'm using Datepicker in the designer, and I want to have two buttons that allow me to go forward or backwards one day, i.e next and previous But I can't find a way to navigate I also have a today button to return me back to today which works but I can't figure the next previous Code: Copy Private Sub btnToday_Action Log("btnToday") DateTime.DateFormat="dd-MM-yyyy" Dim Today As String = DateTime.Date(DateTime.Now) Log("Today " & Today) DatePicker1.DateFormat = "dd-MM-yyyy" DatePicker1.DateTicks = TodayTick End Sub [/code}
Erel B4X founder Staff member Licensed User Longtime User May 13, 2021 #2 you can remove the DateFormat lines. They don't do anything useful. Code: Copy Dim p As Period p.Days = 1 'or -1 DatePicker1.DateTicks = DateUtils.AddPeriod(DatePicker1.DateTicks, p) Upvote 0
you can remove the DateFormat lines. They don't do anything useful. Code: Copy Dim p As Period p.Days = 1 'or -1 DatePicker1.DateTicks = DateUtils.AddPeriod(DatePicker1.DateTicks, p)
Colin Evans Active Member Licensed User Longtime User May 13, 2021 #3 Thank you Erel, super star Upvote 0