如何使用日历控件中的日期在标签上显示工作日 [英] how to show weekday on label using date from calendar control
本文介绍了如何使用日历控件中的日期在标签上显示工作日的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用日历控件中的日期在标签控件上显示工作日.
怎么做.任何解决方案.
Hi,
I want to display weekday on label control using date from calender control.
How to do that. Any solution.
推荐答案
检查 ^ ].
从日历控件中获取DateTime值后,只需要获取.DayOfWeek属性(0-6)并将其转换为文字天即可.将其应用于标签即可完成.
Check this[^] out.
Once you have the DateTime value from the calendar control you just need to get the .DayOfWeek property (0-6) and convert it to a literal day. Apply that to your label and you are done.
这篇关于如何使用日历控件中的日期在标签上显示工作日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文