的DateTimePicker和秒 [英] DateTimePicker and seconds

查看:106
本文介绍了的DateTimePicker和秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索如此,但便无法得到答案。我用一个WinForms对话框一个DateTimePicker并指定自定义格式为: DD.MM.YYYY HH:MM:SS 。但是的DateTimePicker不显示秒,它总是显示 00 他们。即使我键入如15秒,该值是正确的,但它的显示错误。

I've searched SO, but could't get the answer. I use a DateTimePicker on a WinForms dialog and specify a custom format: dd.MM.yyyy HH:mm:ss. But DateTimePicker doesn't show the seconds, it always shows 00 for them. Even if I type e.g. "15" seconds, the value is correct but it's shown wrong.

我做了什么错了?

推荐答案

我发现出我自己的答案。如果我绑定数据源的DateTimePicker的Text属性,秒将不会显示。我必须绑定到值属性。

I've found out the answer by myself. If I bind the data source to the Text property of DateTimePicker, the seconds will not be shown. I have to bind to the Value property instead.

这篇关于的DateTimePicker和秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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