C#.net Windows开发 [英] C#.net windows development

查看:85
本文介绍了C#.net Windows开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开发一个Windows应用程序,在其中我需要以下内容
datetimepicker,其中当我选择月份时,它将在文本框中显示所选月份的天数
例如
如果我在datetimepicker中选择2011年11月,那么在文本框中它将显示2011年11月的天数,即30

如果我选择2011年12月,那么它将在文本框中显示31
我想在c#.net中使用此代码,我应该使用哪种方法以及如何为我提供示例.



Thanx.

Hi ,i am going to develop an windows application in which i want an following thing
datetimepicker in which when i select the month then it will show the number of days in that selected month into a text box
Eg.
If i select Nov-2011 in datetimepicker then in the textbo it will hows the number of days in nov-2011 i.e 30

If i select Dec-2011 then it will show 31 in textbox
i want this code in c#.net which method should i used & how please help me with an example.



Thanx.

推荐答案

您只需检查datetimepicker的值:返回的月份是否为31(1月,3月,5月,7月,8月,10月, 12月)或30(4月,6月,9月,11月)天,或者如果是2月,请检查年份是否为a年.然后将此数字插入您的文本框中.

但是我知道,您说的是我想要在c#.net中使用此代码" .只需自己尝试一下,您可能会喜欢自己完成此(相对简单)任务的温暖感觉. :-)
You only have to check the datetimepicker''s value: Does the returned month have 31 (Jan, Mar, May, Jul, Aug, Oct, Dec) or 30 (Apr, Jun, Sep, Nov) days or in case it''s February, check whether the year is a leap year or not. Then insert this number in your textbox.

But I see, you say "i want this code in c#.net". Just try it yourself, you might like the warm feeling of having accomplished this (relatively simple) task yourself. :-)


这篇关于C#.net Windows开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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