字體:小 中 大 | |
|
|
2019/08/11 11:04:00瀏覽40|回應0|推薦0 | |
引用至https://dotblogs.com.tw/marcus116/archive/2011/04/10/22441.aspx 使用心得如下
protected void Page_Load(object sender, EventArgs e) { } protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { // 建立農曆類別實體 TaiwanLunisolarCalendar myTaiwan = new TaiwanLunisolarCalendar(); // 取得對應到的農曆月&日 int myMonth = myTaiwan.GetMonth(e.Day.Date); int myDay = myTaiwan.GetDayOfMonth(e.Day.Date); string myLunisolarDate = string.Format("{0}/{1}", myMonth, myDay); string myLunisolarDateToolTip = string.Format("農曆 {0}月{1}日", myMonth, myDay);; Label myLabel = new Label(); myLabel.Text = myLunisolarDate; myLabel.ForeColor = System.Drawing.Color.Blue; myLabel.Font.Size = FontUnit.XSmall; myLabel.ToolTip = myLunisolarDateToolTip; e.Cell.Controls.Add(myLabel); } |
|
( 知識學習|語言 ) |