单击日历控件时,使用三个文本框插入日期,月份和年份 [英] Using the three textbox to insert the date, month and year separate when clicking calendar control
本文介绍了单击日历控件时,使用三个文本框插入日期,月份和年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从日历控件中拆分日期,月份和年份,并将其绑定在客户端的相应文本框中。
我尝试了什么:
指导我为此做了什么?
I want to Split the Date, Month and Year from calendar control and bind it in corresponding text box in client side.
What I have tried:
Guide me what i have do for this ?
推荐答案
假设你是在WinForms中工作,然后您需要在表单上放置DateTimePicker或类似的东西。
然后在适当的事件中编写一些代码来填充文本框。
对于Winforms Datepicker [ ^ ]将成为控件,OnValueChanged
将是一个很好的选择方法您可以放置代码。
对于WPF,日历控件 [ ^ ]可能是 Calendar.OnDisplayDateChanged(CalendarDateChangedEventArgs)方法 [ ^ ]将是您选择的方法。
对于ASP,请参阅日历类(System.Web.UI.WebControls)| Microsoft Docs [ ^ ]并且可能使用 Calendar.OnSelectionChanged Method [ ^ ]
通过所有这些链接提供样本。
Assuming you are working in WinForms then you will need to place a DateTimePicker or similar onto your form.
Then you write some code in the appropriate event to populate the textboxes.
For a Winforms Datepicker[^] would be the control andOnValueChanged
would be a good choice of a method into which you would place your code.
For WPF a Calendar control[^] would be the thing and probably the Calendar.OnDisplayDateChanged(CalendarDateChangedEventArgs) Method[^] would be the method to choose.
For ASP see Calendar Class (System.Web.UI.WebControls) | Microsoft Docs[^] and perhaps use the Calendar.OnSelectionChanged Method[^]
There are samples available via all of those links.
这篇关于单击日历控件时,使用三个文本框插入日期,月份和年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文