How to enable DateTimePicker to use both date and time z
Recently in one of my project I needed to have an option to display the DateTimePicker allowing user to pick both the date and the time. When I drag the control onto the form however I could only chooses the date or the time but not both. Well actually you can have both, all you have to do is use the CustomFormat property.

Here's how:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.dateTimePicker1.CustomFormat = "MM/dd/yyyy HH:mm";
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
}
}
}
How to enable DateTimePicker to use both date and time z的更多相关文章
- 基于bootstrap的datetimepicker插件
1.当时使用的资源地址:http://www.bootcss.com/p/bootstrap-datetimepicker/ 2.如何让时间只显示到日期,不显示具体时刻 控制显示精度的是datetim ...
- Ext.util.Format.date 时间格式的设置与转换
Ext.util.Format.date 如下这段简单的代码: var d = new Date(value.time); var s = Ext.util.Format.date(d, 'Y-m- ...
- bootstrap--双日历插件
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 自动开机和自动关机设定方法(包括linux和windows)
(一) linux 机器 1.关机 : 编辑 /etc/crontab添加一条并且保证crontab服务的运行即可 f1 f2 f3 f4 f5 root sudo shutdown –h now 假 ...
- EXPDP IMPDP 知识总结
Data Pump Export ATTACH Default: job currently in the user's schema, if there is only one Purpose(目的 ...
- (转载)iOS Framework: Introducing MKNetworkKit
This article is available in Serbo-Croatian, Japanese and German. (Translations in Serbo-Croatian b ...
- RH033读书笔记(14)-Lab 15 Switching Users and Setting a Umask
Lab 15 Switching Users and Setting a Umask Goal: Become familiar with the use of several essential c ...
- JAVA提高五:注解Annotation
今天我们学习JDK5.0中一个非常重要的特性,叫做注解.是现在非常流行的一种方式,可以说因为配置XML 比较麻烦或者比容易查找出错误,现在越来越多的框架开始支持注解方式,比如注明的Spring 框架, ...
- MySQL单机单实例安装脚本(转载)
说明:使用mysql generic tar.gz包快速安装mysql 三个文件installation_of_single_mysql.sh.template_install-my.cnf.mysq ...
随机推荐
- 超实用js代码段一
1: 过滤首尾空格trim.2:过滤左边空格ltrim 3:过滤右边空格 一:用正则方法写成三个函数. <script type="text/javascript" ...
- 深入理解JVM—字节码执行引擎
原文地址:http://yhjhappy234.blog.163.com/blog/static/3163283220122204355694/ 前面我们不止一次的提到,Java是一种跨平台的语言,为 ...
- java 写文本文件
code 1:将特定String写入特定文件,不覆盖. import java.io.*; import java.util.*; public class OutputLog { public st ...
- A. Counting Kangaroos is Fun(贪心)
#include<stdio.h> #include<algorithm> using namespace std; ]; int main() { int i,n,high; ...
- 从零开始,让你的框架支持CocoaPods
本文为投稿文章,作者:奴良(简书) 这两天一直琢磨着想让自己的一个照片多选框架支持CocoaPods下载安装,就搜了好多资料,但是搜到的资料大多都是最基本的,并没有解决我遇到的问题,问题如下: 当自己 ...
- [HIHO1051]补提交卡(枚举,贪心)
题目链接:http://hihocoder.com/problemset/problem/1051 思路:先排序,然后枚举连续的长度为m的子段,用这个段之后的第一个天数减去这个段之前的第一个天数再-1 ...
- [UVA315]Network(tarjan, 求割点)
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- window注册表
打开注册表: 可以用快捷键 win + r ,然后输入 Regedit 回车,会打开注册表. 注册表添加一个键值对到 操作如下: 1.先创建一个 .reg 后缀的文件. 2.文件内容如下: Wind ...
- 【转载】React入门-Todolist制作学习
我直接看的这个React TodoList的例子(非常好!): http://www.reqianduan.com/2297.html 文中示例的代码访问路径:http://127.0.0.1:708 ...
- poj 2528 Mayor's posters(线段树)
题目:http://poj.org/problem?id=2528 题意:有一面墙,被等分为1QW份,一份的宽度为一个单位宽度.现在往墙上贴N张海报,每张海报的宽度是任意的, 但是必定是单位宽度的整数 ...