使只有在的WinForms的DateTimePicker工作作为TimePicker [英] Make DateTimePicker work as TimePicker only in WinForms

查看:103
本文介绍了使只有在的WinForms的DateTimePicker工作作为TimePicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制的DateTimePicker 只选择时间吗?我不知道如何禁用当你按在的DateTimePicker 右侧的按钮,下降的日历控件。


解决方案

一个片段出 MSDN的




下面的代码示例演示如何
创建
可以让用户选择一个DateTimePicker 。唯一的一次




  timePicker =新的DateTimePicker(); 
timePicker.Format = DateTimePickerFormat.Time;
timePicker.ShowUpDown = TRUE;


How to restrict DateTimePicker to select the time only? I don't know how to disable calendar control which drops when you press the button at the right of DateTimePicker.

解决方案

A snippet out of the MSDN:

'The following code sample shows how to create a DateTimePicker that enables users to choose a time only.'

timePicker = new DateTimePicker();
timePicker.Format = DateTimePickerFormat.Time;
timePicker.ShowUpDown = true;

这篇关于使只有在的WinForms的DateTimePicker工作作为TimePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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