หน้าเว็บ

วันพฤหัสบดีที่ 5 สิงหาคม พ.ศ. 2553

Calendar Winforms Control

Screen short

Class Diagram

Update: April 11, 2011 + Demo for VB.Net
Download Here include sourcecode, demo(c#, vb.net)

Modify by : thammapat[at]gmail.com

Job base on : Calendar of Jose Menendez Póo (link to original: http://www.codeproject.com/KB/docview/WinFormsCalendarView.aspx)
Modify date : October 30, 2009
Change Log:

  1. Calendar class
    • Inherit from class Control instead of ScrollableControl.
    • Add vertical scrollbar for DaysMode.Expanded view.
    • Add event 'ItemDrawContent' 
    • Add method 'BeginUpdate' and 'EndUpdate'.
    • Add property 'MultiSelect', 'RendererMode'
    • Add ToolTip component
    • Add Icon
    • Override 'PreProcessMessage' for supported keyboard navigator(left, right, up, down, pageup, pagedown) and editing item(insert, del, escape, f2).
    • Override 'WndProc' to force focus after key down.
    • Change some property name to shortly.
    • Change method 'ScrollCalendar' from move a week -> move a month.
    • Change all event signature to EventHandler style.
    • Adjust FinalizeEditMode.
    • Adjust draw item content.
    • Adjust xml document.
    • Double check before raise event 'ItemDatesChanged' is realy changed.
  2. CalendarItemCollection class
    • Add method 'Sort' when 'CollectionChanged'
  3. CalendarItem class
    • Add Property: ToolTipText, Values, Visible. 
    • Add Method: GetValue, LoadDataRow
    • Implement interface ICloneable
    • Adjust resizing, dragging behavior
  4. CalendarSystemRenderer class
    • Change some color
  5. MonthView class
    • Inherit from class Control instead of ContainerControl.
    • Add Icon
    • Add Method: SetSelectionRange(start, end)
    • Add event 'DateChanged'.
    • Add ContextMenuStrip when mouseup at title Month or Year.
    • Override 'PreProcessMessage' for supported keyboard navigator(left, right, up, down, pageup, pagedown)
    • Override 'WndProc' to force focus after key down.
    • Adjust OnMouseMove when highlighting date[s], event 'SelectionChanged' will be raise after mouse up.
    • Adjust OnMouseDown when clicked at gray text, go to that month.
    • Adjust xml document.
    • Change property name from 'DayGrayedText' -> 'TrailingForeColor'
    • Remove property 'MonthTitleColorInActive', 'MonthTitleTextColorInActive'
Download Here include sourcecode, demo(c#, vb.net)

5 ความคิดเห็น:

  1. Thanks, great calendar control. I have one problem, that is when i have another listview, when highlight listview items, it seems that it's always change the focus to calendar control, and i can't move up or down on the listview items using up and down keys. Is there a way to by pass that? Thanks

    ตอบลบ
  2. Great job. I think you added the DefaultStartTime property, which I presume is to set the top view of the time position to the specified value, e.g. if 08:30:00 is set, then 8:30 is the top time viewed?
    If this was your intention, then perhaps EnsureVisible function may need some work, plus setting scrolllbar position. I tried, but no succeess so far.
    Could you have a look at it?
    Thanks

    ตอบลบ