Results 1 to 3 of 3

Thread: display datetimepicker as blank

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    176

    display datetimepicker as blank

    Hi All.
    In my detail form I would like to diaplay datetimepicker field as blank in case when user open new record. Is it possible to display blank datetimepicker? How it to do?
    Thanls.

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: display datetimepicker as blank

    I would love for someone to prove me wrong, but it does not look like this is possible. You would have to create your own DateTimePicker from scratch inheriting from Control. It seems all the methods it uses to paint the actual text that you see are declared Private meaning we can't override any of them to decide when they perform.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: display datetimepicker as blank

    It's possible but it's a bit fiddly. You need to set the Format to Custom and then the CustomFormat to " ", i.e. a single space character. You then need to handle the ValueChanged event and set the CustomFormat or the Format to some other value so that the Value gets displayed.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width