Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Empty datetimepicker

Empty datetimepicker

Scheduled Pinned Locked Moved C#
csharp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thachil
    wrote on last edited by
    #1

    I want to dispaly empty datetimepicker, which means don't want to display today date as default in C#.NET windows application. Plz Reply.

    Jo

    D V K 3 Replies Last reply
    0
    • T thachil

      I want to dispaly empty datetimepicker, which means don't want to display today date as default in C#.NET windows application. Plz Reply.

      Jo

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Set the DateTimePicker.Format property to Custom and DateTimePicker.CustomFormat property to space.

      Avoid Google. Use Blackle[^]

      T 1 Reply Last reply
      0
      • D dan sh

        Set the DateTimePicker.Format property to Custom and DateTimePicker.CustomFormat property to space.

        Avoid Google. Use Blackle[^]

        T Offline
        T Offline
        thachil
        wrote on last edited by
        #3

        But i want to do in runtime.....

        Jo

        D 1 Reply Last reply
        0
        • T thachil

          But i want to do in runtime.....

          Jo

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          You can do this at runtime. What is the problem?

          Avoid Google. Use Blackle[^]

          1 Reply Last reply
          0
          • T thachil

            I want to dispaly empty datetimepicker, which means don't want to display today date as default in C#.NET windows application. Plz Reply.

            Jo

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            In addition to what d@nish said, you must initialize the value to DateTime.MinValue, and in the methods which use this value, make sure it's not DateTime.MinValue - this ensures the user has selected a date. Also, in your dateTimePicker1_ValueChanged handler, use dateTimePicker1.Format = DateTimePickerFormat.Long; or whatever format you want - otherwise the user will see an empty box, no matter what he selects!

            Cheers, Vikram.


            The hands that help are holier than the lips that pray.

            1 Reply Last reply
            0
            • T thachil

              I want to dispaly empty datetimepicker, which means don't want to display today date as default in C#.NET windows application. Plz Reply.

              Jo

              K Offline
              K Offline
              Kjetil Svendsen
              wrote on last edited by
              #6

              Have a look at this: http://www.codeproject.com/KB/selection/Nullable_DateTimePicker.aspx[^] Kjetil

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups