DateTimePicker reset min max Date

Posted on 2011-05-10
Last Modified: 2012-06-27
Hello EE,

in my code, i change the MinDAte and maxDate of the datetimepicker...
but i would like to be able to put it back on "Default values" also.

I know i could type like  .mindate = '1800-01-01' or something like that but is there an event or method i can call that it refreshes the control to default values like if I had just create it?

A kind of:  dtpPicker.Refresh()  dtpPicket.ResetValues   you know
Question by:PhilippeRenaud
    LVL 2

    Accepted Solution

    to refresh

    dateTimePicker1.Value = System.DateTime.Now;


    picker.Value = picker.Value.Date;
    EDIT: To specify a particular time, you'd use something like:
    TimeSpan time = new TimeSpan(3, 30, 0); // 3 hours and 30 minutespicker.Value = picker.Value.Date + time;

    'Created a global string variable with initial value
         Dim gstrStartDate As String = "20/01/1988"    '(Australian Date Format)

    Private Sub btnReset_Click
    'Set Start Date to 20/01/1988
            gstrStartDate = "20/01/1988"
            dtpStartDate.Value = Convert.ToDateTime(gstrStartDate)
    End Sub
    LVL 1

    Author Closing Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now