简体   繁体   English

如何设计日历控件

[英]how to design a calendar control

I need to design a calendar control which should be added to our companie's application (I know there's already quite a lot calendar controls but I shall develop our own one...). 我需要设计一个日历控件,应该添加到我们公司的应用程序中(我知道已经有很多日历控件,但我会开发自己的日历控件......)。

How should I start, should I use a kind of table to display the days or should I completely draw my own grid? 我应该如何开始,我应该使用一种表来显示日期还是应该完全绘制自己的网格? How can I do this (I do not need rdy-to-use code, I just need some ideas...) 我该怎么做(我不需要使用rdy-to-use代码,我只需要一些想法......)

The application is written in C# as a WindowsForms application (thanks for the hint, forgot to mention this in first case...) 该应用程序是用C#编写的一个WindowsForms应用程序(感谢提示,在第一种情况下忘了提到它......)

Seeing your comment about WinForms and: 看到你对WinForms的评论和:

I need to develop an own one because it must be integrated in an already existent application, I need full access in means of style and functionality 我需要开发一个自己的,因为它必须集成在一个已经存在的应用程序中,我需要在样式和功能方面完全访问

makes me suggest to use ready project http://www.codeproject.com/KB/selection/MonthCalendar.aspx and modify it if necessary. 让我建议使用现成的项目http://www.codeproject.com/KB/selection/MonthCalendar.aspx并在必要时进行修改。 I use it in my own little project and it works like a charm. 我在我自己的小项目中使用它,它就像一个魅力。 It provides full source if necessary so you can integrate it easily and modify if you think it's not fit enough. 它在必要时提供完整的源代码,因此您可以轻松集成它并在您认为fit修改。

In the end if you end up not using it, you can peak at the sources and functionality it implements and do it your own way. 最后,如果你最终没有使用它,你可以在它实现的源和功能上达到顶峰,并按照自己的方式进行。

To me redoing it from scratch is a bit pointless especially with such a good / free one. 对我来说,从头开始重做它有点毫无意义,尤其是这样一个好/免费的。

If you are developing a web application then I would seriously look at using jquery. 如果您正在开发Web应用程序,那么我会认真考虑使用jquery。 A good calendar control should be done client side so I would be looking at some form of java script solution. 一个好的日历控件应该在客户端完成,所以我会看一些形式的java脚本解决方案。 If you look at jquery-calendar.js as a good example you will see the complexity involved in developing your own control. 如果你看一下jquery-calendar.js作为一个很好的例子,你将看到开发自己的控件所涉及的复杂性。

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

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