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()
      }

    }

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

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

  • 相关阅读:
    用户态和内核态
    04 _ 如何利用事务消息实现分布式事务?
    03 _ 消息模型:主题和队列有什么区别
    01 _ 为什么需要消息队列?
    洛谷P2257 YY的GCD
    HDU2669 Romantic (扩展欧几里德)
    CQOI2015 选数
    A. Pride
    测试开发进阶——python-java——appium003——Desired Capabilities —— 自动化常用方法——面试整理
    HDU 5050
  • 原文地址:https://www.cnblogs.com/tonyepaper/p/1203738.html
Copyright © 2011-2022 走看看