开发者

Creating DateTime object from DatePicker and TimePicker control

How to create DateTime object from DatePicker and TimePicker controls in Windows Phone 7?

DateTime object constructor accepts only int with yea开发者_开发知识库rs, months etc. Is there a smart way to combine date and time and assign it to DateTime ?


use

DateTime MyDateTime = ((DateTime) MyDatePicker.Value).Date.Add (((DateTime)MyTimePicker.Value).TimeOfDay);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜