Results 1 to 3 of 3

Thread: [RESOLVED] DateTimePicker appearence problem!!!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2009
    Posts
    1,103

    Resolved [RESOLVED] DateTimePicker appearence problem!!!

    the DateTimePicker in my form appears like this:
    Attachment 72262
    I want to give it an appearence like this........
    Attachment 72263
    i.e,only the date will be displayed in the format of DD/MM/YR
    How to achieve this?
    Last edited by gautamshaw; Feb 21st, 2010 at 01:22 PM.

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: DateTimePicker appearence problem!!!

    First set its Format property to Custom. Second set its Customformat property to M/d/yyyy. That’s all.

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

    Re: [RESOLVED] DateTimePicker appearence problem!!!

    Unless you have a very good reason for enforcing a specific format on the user it is a better idea to use a system format. The default for a DateTimePicker is Long, so what you see is the standard long date format on your system. If you went into the Windows regional Settings and change the long date format then the DateTimePicker would diplay something different.

    I would suggest that you simply change the Format to Short, and then each user will see the short date format they expect to see on their own machine. If you start specifying the order of the month and day then you can cause issues for some people. For instance, if the DTP displays July 1st as 1/7/2009 then someone with US settings will likely interpret that as January 7th, because that's the format that they expect on their machine. If you the Short Format then an Australian (and many others) will see 1/07/2009 and an American will see 7/01/2009 and they will both correctly interpret it as July 1st. As you can see from his post, VBDT already got confused:
    Second set its Customformat property to M/d/yyyy.
    It happens easily to Americans though.
    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