如何在C#中创建自定义日历? [英] How to create custom calendar in C#?

查看:120
本文介绍了如何在C#中创建自定义日历?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我最喜欢的日期设置为日历,日历应该根据我的日期工作。



我想将我的日历日期设置为10/2/2107它必须在每天后增加它,我的意思是当我打开我的应用程序明天日历日期必须更改为10/3/2017而当我打开后天日期必须更改为10/4/2017所以on ....



但是当我打开我的应用程序日历时获取系统日期我不需要系统日期我需要自己的日历日期。



了解更多详情我添加了几张照片。



我尝试了什么:



 this.monthCalendar1.TodayDate = new System.DateTime(2017,10,3,0,0,0,0); 





但是当我打开应用程序日历时获取系统日期我不需要系统日期我需要自己的日历日期。



更多细节我添加几张图片。

解决方案

尝试在datetimepicketr的属性中更改自定义格式

格式将类似于MM / DD / yyyy


I want to set my favorite date to calendar and calendar should work according to my date.

I want set my calendar date to 10/2/2107 and it must increment it is day after each day, I mean when I open my application tomorrow calendar date must be change to 10/3/2017 and when I open the day after tomorrow the date must be change to 10/4/2017 and so on....

but when I open my Application calendar get the system date I don't need the system date I need my own calendar date.

for more Details I add a few pictures.

What I have tried:

this.monthCalendar1.TodayDate = new System.DateTime(2017, 10, 3, 0, 0, 0, 0);



but when I open my Application calendar get the system date I don't need the system date I need my own calendar date.

for more Details I add a few pictures.

解决方案

Try change the custom format in datetimepicketr's property
the format will be like MM/DD/yyyy


这篇关于如何在C#中创建自定义日历?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆