日期控件选择的一点问题,请教?

yumanqing 2007-06-15 11:48:50
vs2005 winform中的 日期控件 monthCalendar
以下的一段代码的作用是一次选择一周,我在WIN2000的电脑上是选择的背景色是兰色,字体是白色,符合要求,可是到WINXP上就选择的背景色也是白色,字体也是白色,该怎么设置呀?帮我看看在你们的系统上是什么现象?

//选中一周
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
DateTime dt = monthCalendar1.SelectionStart;
//chinese tradition, sunday is the last day of the week
int n=(dt.DayOfWeek == DayOfWeek.Sunday? 7:(int)dt.DayOfWeek);
DateTime mon = dt.AddDays(1-n);
DateTime sun = dt.AddDays(7-n);
SelectionRange s = new SelectionRange(mon, sun);
monthCalendar1.SelectionRange = s;
}
...全文
297 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tuwicn 2010-10-08
  • 打赏
  • 举报
回复
遇到这问题了,救命
whslovexyp 2007-06-15
  • 打赏
  • 举报
回复
官方说明:Setting the SelectionRange for a MonthCalendar control that has visual styles enabled will result in the selection range not painting correctly on the control.
whslovexyp 2007-06-15
  • 打赏
  • 举报
回复
我XP,如你所说问题
yumanqing 2007-06-15
  • 打赏
  • 举报
回复
UP
yumanqing 2007-06-15
  • 打赏
  • 举报
回复
没人遇到过吗?
yumanqing 2007-06-15
  • 打赏
  • 举报
回复
怎么解决呢?

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧