|
I need to do the following: build a custom control with two datetimepickers and two labels. I need to use get or get/set to add test to the labels and to get the number of days between the two selected dates. I then need to test the control by using the first datetimepicker as a pickup date for a rental car and the second date as the return date. The total days is then used to calcuate the rental rate, at $50 per day. I have made the control and added it to the library so it is on the toolbox and have added this control to my test program. The code I have written for the control is as follows: ReadOnly Property totdays() As Double Get totdays = DateDiff(DateInterval.Day, Date1, Date2) Return totdays End Get End Property
ReadOnly Property startdate() As String Get startdate = "Start Date:" Return startdate Lbl1.Text = startdate End Get End Property
ReadOnly Property enddate() As String Get enddate = "End Date:" Return enddate Lbl2.Text = enddate End Get End Property End Class
The code for the test program is as follows: Private Sub BtnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalc.Click Dim totdays As Integer lblCharge.Text = totdays
End Sub
I cannot get the text to display in the labels and get a return of 0 for the total charge because the totday value is 0.
Any guidance will be greatly appreciated.
|