简体   繁体   English

C#Datetimepicker:将前色设置为特定日期

[英]C# Datetimepicker : Set forecolor to Specific Date

I am using a datetimepicker in my application. 我在应用程序中使用了datetimepicker。 I want it to display specific dates (in this case, all Holidays of a month) with one specific color (ie The holidays will be shown as red or blue or any color) when the datetimepicker is clicked and its monthview (i don't know exact name of this) is prompted. 我希望它显示特定的日期(在这种情况下,一个月的所有假期),当单击datetimepicker并按月查看时(我不显示,假期将显示为红色或蓝色或任何颜色)知道确切名称)。 Is it possible with default datetimepicker ? 默认datetimepicker是否可能?

Suppose there are holidays in August are all the public holidays (in this case, every fri and sat) and some specific holidays (such as 13 Aug,19 Aug etc) and I want to show them in red/blue color. 假设8月有个假期是所有公共假期(在这种情况下为每个星期五和周六)和一些特定的假期(例如8月13日,8月19日等),我想用红色/蓝色显示。 This will also occur when I change the month to September (or any month). 当我将月份更改为9月(或任何月份)时,也会发生这种情况。 I shall bring the holidays from database where I keep my holiday records. 我将从数据库中保存假期记录的地方带走假期。

Thanks in advanced. 提前致谢。

A longer time ago i had to do similar solution for a busines Application. 更长时间之前,我必须为商务应用程序执行类似的解决方案。 you might wanna look at http://msdn.microsoft.com/en-us/magazine/dd882520.aspx i don't think i can sum it up better than this site. 您可能想看一下http://msdn.microsoft.com/zh-cn/magazine/dd882520.aspx我不认为我可以比这个网站更好地总结一下。

Look at "Figure 8 The RedLetterDays Display". 请看“图8 The RedLetterDays显示”。 Sounds like the thing you need. 听起来像您需要的东西。

greetings 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM