|
-
Jan 27th, 2011, 09:48 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Month Calendar trouble
I have a simple code with a month calendar.
vb Code:
Dim CurrentStart As Date
Dim CurrentEnd As Date
Dim TransactDates As List(Of Date)
Protected Sub LoadMonth()
TransactDates = New List(Of Date)
for i=1 to 10
TransactDates.Add(DateAdd(DateInterval.Day, i, TransactionMonthCalendar.SelectionRange.Start))
Next
TransactionMonthCalendar.BoldedDates = TransactDates.ToArray
End Sub
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not DesignMode Then
CurrentStart = Today.Date
CurrentEnd = Today.Date
LoadMonth()
End If
End Sub
Private Sub TransactionMonthCalendar_DateChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles TransactionMonthCalendar.DateChanged
If e.Start.Month <> CurrentStart.Month Or e.Start.Year <> CurrentStart.Year Then
CurrentStart = e.Start
LoadMonth()
End If
If e.Start <> CurrentStart Or e.End <> CurrentEnd Then
CurrentStart = e.Start
CurrentEnd = e.End
End If
End Sub
The code should work like this: Every time i moved the month, it should make 10 bold days in that month.
It works fine in VS 2010 and VS2008. The problem is, after I copy (compile with debug/release) to client computers, it start made trouble. On Win 7 OS, the calendar render nothing if i press the left or right arrow, then it suddenly go to january 1753. On Win XP OS, I can't even press left or right arrow button to change month. If I press that left and right button, it will keep moving forward without stopping.
I hope anyone can have some solutions to me. I already have this bug for about a few months and still don't have any clue on how to solve it..
Thanks n regards..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|