Hello,
I put together a user control with two date pickers and labels. I am to set the labels text property and get the number of days between the date ranges. I have the code to do this, but when I test the control, the labels do not have the new text property. I haven't tested the date range portion yet. I have followed the steps in the text book on building the solution so that the control is available when using the form. Could someone let me know what I'm doing wrong with setting the label text? Here is my control code:
VB Code:
Public Class DateRange Public WriteOnly Property PickUp() As String Set(ByVal value As String) Label1.Text = "PickUp Day" End Set End Property Public WriteOnly Property DropOff() As String Set(ByVal value As String) Label2.Text = "DropOff Day" End Set End Property Public ReadOnly Property GetDays() As String Get 'Declare variables Dim DayCount As Integer 'Determine number of days DayCount = CInt((DateDiff(DateInterval.Day, DateTimePicker1.Value, DateTimePicker2.Value))) Return CStr(DayCount) End Get End Property End Class
Thanks




Reply With Quote