From 7f1f0ce3854e7b92ee7adeb53e9a6668adbde35b Mon Sep 17 00:00:00 2001 From: Erik Dasque Date: Fri, 30 Apr 2004 13:27:22 +0000 Subject: [PATCH] This defines a Date property for Calendar Note that the setter causes CalendarChange events to be fired public DateTime Date svn path=/trunk/gtk-sharp/; revision=26417 --- gtk/Calendar.custom | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gtk/Calendar.custom b/gtk/Calendar.custom index 1613fc70a..69c901f15 100644 --- a/gtk/Calendar.custom +++ b/gtk/Calendar.custom @@ -14,3 +14,21 @@ public DateTime GetDate () return new DateTime ((int) year, (int) month + 1, (int) day); } + +// This defines a Date property for Calendar +// Note that the setter causes CalendarChange events to be fired +public DateTime Date + +{ + get { + return this.GetDate(); + } + set { + uint month= (uint) value.Month-1; + uint year= (uint) value.Year; + uint day = (uint) value.Day; + + SelectMonth(month,year); + SelectDay(day); + } +} \ No newline at end of file