davepamn Active Member Licensed User Longtime User Feb 24, 2015 #1 I need to dynamically create a date picker for a scrollview and then initialize it with a parameter date.
I need to dynamically create a date picker for a scrollview and then initialize it with a parameter date.
Erel B4X founder Staff member Licensed User Longtime User Feb 25, 2015 #2 Code: Copy Dim dp As DatePicker dp.Initialize("dp") dp.Ticks = DateTime.Now Page1.RootPanel.AddView(dp,0, 0, 100%x, 200) Upvote 0
Code: Copy Dim dp As DatePicker dp.Initialize("dp") dp.Ticks = DateTime.Now Page1.RootPanel.AddView(dp,0, 0, 100%x, 200)
davepamn Active Member Licensed User Longtime User Feb 25, 2015 #3 How do I set the date picker using mm/dd/yyyy? Do you have a function that converts a date into ticks Upvote 0
How do I set the date picker using mm/dd/yyyy? Do you have a function that converts a date into ticks
Erel B4X founder Staff member Licensed User Longtime User Feb 26, 2015 #4 Please start a new thread for this question. Upvote 0
davepamn Active Member Licensed User Longtime User Mar 4, 2015 #5 Code: Copy Dim arrDatePicker(100) As DatePicker arrDatePicker(iDatePickerCounter).Mode=arrDatePicker(iDatePickerCounter).MODE_DATE DateTime.DateFormat = "MM/dd/yyyy" arrDatePicker(iDatePickerCounter).Ticks=DateTime.DateParse(sTestIdValue) This code worked! I was able to set a date and format to Month, Day, and Year in the Picker Control Upvote 0
Code: Copy Dim arrDatePicker(100) As DatePicker arrDatePicker(iDatePickerCounter).Mode=arrDatePicker(iDatePickerCounter).MODE_DATE DateTime.DateFormat = "MM/dd/yyyy" arrDatePicker(iDatePickerCounter).Ticks=DateTime.DateParse(sTestIdValue) This code worked! I was able to set a date and format to Month, Day, and Year in the Picker Control
davepamn Active Member Licensed User Longtime User Mar 4, 2015 #6 this snippet reverses the ticks to a date Code: Copy sTestValue=GetDate(arrDatePicker(i).ticks) Public Sub GetDate(Ticks As Long) As String Dim df As String = DateTime.DateFormat DateTime.DateFormat = "MM/dd/yyyy" Dim res As String = DateTime.Date(Ticks) DateTime.DateFormat = df Return res End Sub Upvote 0
this snippet reverses the ticks to a date Code: Copy sTestValue=GetDate(arrDatePicker(i).ticks) Public Sub GetDate(Ticks As Long) As String Dim df As String = DateTime.DateFormat DateTime.DateFormat = "MM/dd/yyyy" Dim res As String = DateTime.Date(Ticks) DateTime.DateFormat = df Return res End Sub
gjoisa Active Member Licensed User Longtime User May 21, 2015 #7 Erel said: Code: Copy Dim dp As DatePicker dp.Initialize("dp") dp.Ticks = DateTime.Now Page1.RootPanel.AddView(dp,0, 0, 100%x, 200) Click to expand... How to dismiss the picker after setting the required date ? Upvote 0
Erel said: Code: Copy Dim dp As DatePicker dp.Initialize("dp") dp.Ticks = DateTime.Now Page1.RootPanel.AddView(dp,0, 0, 100%x, 200) Click to expand... How to dismiss the picker after setting the required date ?
Erel B4X founder Staff member Licensed User Longtime User May 21, 2015 #8 The picker cannot be dismissed. You can remove it like you remove any view (dp.RemoveFromParent). Upvote 0
gjoisa Active Member Licensed User Longtime User May 21, 2015 #9 In other applications there will be done button to dismiss the picker in Iphone . In Ipad if we touch the out side area of picker it will be dismissed . How the do that ? Upvote 0
In other applications there will be done button to dismiss the picker in Iphone . In Ipad if we touch the out side area of picker it will be dismissed . How the do that ?
Erel B4X founder Staff member Licensed User Longtime User May 21, 2015 #10 You can handle the Page_Click event and call Page.ResignFocus. Upvote 0