Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I know this is not a VB.NET forum BUT
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
I know this is not a VB.NET forum BUT
Miscellaneous
Thread ID:
01025942
Message ID:
01025942
Views:
60
Hey gang, I know this is not a VB.NET forum, but I am working on a VB.NET monthly calendar on a form and it's crunch time and I have applied to join a VB.NET forum, but am still awaiting approval. I don't understand why this date range selection is not working correctly. All I want is for the user to choose a start and end date from the month calendar control. When I choose a date it shows the Start date as both the Start and End date and when I choose an End date it shows boths date as being the End date? I think is an easy one, but I am not seeing it. I'll keep researching. Thanks for you help.

Here is my code:
 Private Sub SelRange()
        Dim sr As New SelectionRange
        sr.Start = DateTime.Parse(Me.textBox1.Text)
        sr.End = DateTime.Parse(Me.textBox2.Text)
        ' Assign the SelectionRange object to the
        ' SelectionRange property of the MonthCalendar control. 
        Me.MonthCalendar1.SelectionRange = sr
    End Sub

    Private Sub monthCalendar1_DateChanged(ByVal sender As Object, _
    ByVal e As DateRangeEventArgs) Handles MonthCalendar1.DateChanged
        Me.TextBox1.Text = MonthCalendar1.SelectionRange.Start.Date.ToShortDateString()
        Me.TextBox2.Text = MonthCalendar1.SelectionRange.End.Date.ToShortDateString()

    End Sub
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Next
Reply
Map
View

Click here to load this message in the networking platform