Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Monthly Calendar in VB.Net
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01025954
Message ID:
01025963
Views:
15
>What am I doing wrong? Help please. Thanks. I joined a VB.NET forum, but it takes time to get joined and I want to solve this problem ASAP.
>
>I found this example in VB.NET help and put this code in my Calendar control on a form. Problem is whether I choose start date or end date I always get the same date returned for both start and end.
>
>The code follows:
>
>
> 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
>
I think everithing is good but you must select the renage when you drag mouse over the dates or keep Shift button and click on First and second date. May be I am totaly wrong because I understand VB.NET as much as chinese but who knows.

BTW There is a pure NET forum here not related at all with VFP. Got Setup your account Click on Forums and Mark NET subscribe.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform