How can I retrieve selected month from a monthCalender using C#?
Here is my code:
class Date
{
string month;
public string getMonth(MonthCalendar cn)
{
this.month = cn.SelectionRange.Start.Month.ToString();
return this.month;
}
}
class
{
string curretntMonth;
public string getDate()
{
Date d = new Date();
this.curretntMonth = "%/" + d.getMonth(calendar4show) + "/%";
return this.curretntMonth;
}
}
When I I call getDate() function it always returns current date of my
computer not my selected date "calendar4show". It should be noted that
"calendar4show" is a monthCalander. whats wring with this code? please
help.
No comments:
Post a Comment