zoukankan      html  css  js  c++  java
  • 可以解决DateTimePicker 无法为DBNull的代码.已经测试通过,收藏

    转自 http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c9645/
    using System;
    using System.ComponentModel;
    using System.Globalization;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Windows.Forms;

    // Copyright (c) 2005 Claudio Grazioli, http://www.grazioli.ch
    //
    // This implementation of a nullable DateTimePicker is a new implementation
    // from scratch, but it is based on ideas I took from this nullable 
    // DateTimePickers:
    // - http://www.omnitalented.com/Blog/PermaLink,guid,9ee757fe-a3e8-46f7-ad04-ef7070934dc8.aspx 
    //   from Alexander Shirshov
    // - http://www.codeproject.com/cs/miscctrl/Nullable_DateTimePicker.asp 
    //   from Pham Minh Tri
    //
    // This code is free software; you can redistribute it and/or modify it.
    // However, this header must remain intact and unchanged.  Additional
    // information may be appended after this header.  Publications based on
    // this code must also include an appropriate reference.
    // 
    // This code is distributed in the hope that it will be useful, but 
    // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
    // or FITNESS FOR A PARTICULAR PURPOSE.
    //

    namespace ProjectMentor.Windows.Controls
    {
      
    /// <summary>
      
    /// Represents a Windows date time picker control. It enhances the .NET standard <b>DateTimePicker</b>
      
    /// control with a ReadOnly mode as well as with the possibility to show empty values (null values).
      
    /// </summary>

      [ComVisible(false)]
      
    public class NullableDateTimePicker : System.Windows.Forms.DateTimePicker
      
    {
        
    Member variables

        
    Constructor

        
    Public properties

        
    Private methods/properties

        
    OnXXXX()
      }

    }

    ---------------------------------------------------------------------
    每个人都是一座山.世上最难攀越的山,其实是自己.往上走,即便一小步,也有新高度
    .

    --做最好的自己,我能!!!

  • 相关阅读:
    hdu 3265 Posters(线段树+扫描线+面积并)
    hdu 3974 Assign the task(线段树)
    hdu 1540 Tunnel Warfare(线段树)
    poj 2777 Count Color(线段树(有点意思))
    用Flask+Redis维护Cookies池
    用代理抓取微信文章
    Idea-常用快捷键列表
    用Flask+Redis维护代理池
    Selsnium-Chrome-PhantomJS-爬取淘宝美食
    分析Ajax请求抓取今日头条街拍图片
  • 原文地址:https://www.cnblogs.com/tonyepaper/p/1203738.html
Copyright © 2011-2022 走看看