Results 1 to 10 of 10

Thread: [RESOLVED] DTPicker.

  1. #1

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Resolved [RESOLVED] DTPicker.

    Hi,

    I am using the DTPicker and not concentrating much on the regional settings of the system for the Date format.

    I am using the following code right now for the dtpicker..

    Code:
    
    DTPToday.Format = dtpCustom
    DTPToday.CustomFormat = Format(DTPToday.Value, "dd/mm/yy")
    The problem is that the DTPicker does not allow the user to edit and does not show the selected date from the drop down calendar, the dtpicker is disabled...

    Can anyone please help me to solve this problem.......

    Thanks in advance..

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: DTPicker.

    Hi Ram..

    Try this:
    Code:
    Private Sub Form_Load()
        DTPToday.Format = dtpCustom
        DTPToday.CustomFormat = "dd/MM/yy"
    End Sub
    ..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: DTPicker.

    If you have MSDN installed then hitting F1 should get you this:
    String Fragment Description
    d The one- or two-digit day.
    dd The two-digit day. Single digit day values are preceded by a zero.
    ddd The three-character weekday abbreviation.
    dddd The full weekday name.
    h The one- or two-digit hour in 12-hour format.
    hh The two-digit hour in 12-hour format. Single digit values are preceded by a zero.
    H The one- or two-digit hour in 24-hour format.
    HH The two-digit hour in 24-hour format. Single digit values are preceded by a zero.
    m The one- or two-digit minute.
    mm The two-digit minute. Single digit values are preceded by a zero.
    M The one- or two-digit month number.
    MM The two-digit month number. Single digit values are preceded by a zero.
    MMM The three-character month abbreviation.
    MMMM The full month name.
    s The one- or two- digit seconds.
    ss The two-digit seconds. Single digit values are proceeded by a zero.
    t The one-letter AM/PM abbreviation (that is, "AM" is displayed as "A").
    tt The two-letter AM/PM abbreviation (that is, "AM" is displayed as "AM").
    X A callback field. The control still uses the other valid format characters, and queries the owner to fill in the "X" portion. The owner must be ready to respond to events that request information about how to fill in these fields. Multiple 'X' characters can be used in series to signify unique callback fields.
    y The one-digit year (that is, 1997 would be displayed as "7").
    yy The last two digits of the year (that is, 1997 would be displayed as "97").
    yyy The full year (that is, 1997 would be displayed as "1997").
    If you don't have installed there is always MSDN on-linre - see link in my signature.

  4. #4

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Re: DTPicker.

    Quote Originally Posted by akhileshbc View Post
    Hi Ram..

    Try this:
    Code:
    Private Sub Form_Load()
        DTPToday.Format = dtpCustom
        DTPToday.CustomFormat = "dd/MM/yy"
    End Sub
    ..
    Hi akhi.....

    But the above code shows a date like 05/00/10

    I am trying to show the Current date on Form load in the format " dd/mm/yy "

    Please help...

    Thank you.....

  5. #5
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: DTPicker.

    Try this:
    Code:
    Private Sub Form_Load()
        DTPicker1.Format = dtpCustom
        DTPicker1.CustomFormat = "dd/MM/yy"
        
        DTPicker1.Value = Date
    End Sub
    ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Re: DTPicker.

    I tried it....but a step close now...The dtpicker displays the current Day and Year correctly but the month remains 00....its like 13/00/10...

    What could be the problem.....?

    Please help....

    Thanks.....

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: DTPicker.

    Captialization maybe? Are you sure you are using MM vs. mm?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: DTPicker.

    Quote Originally Posted by Ram2Curious View Post
    What could be the problem.....?
    .....
    Quote Originally Posted by RhinoBull View Post
    mm The two-digit minute. Single digit values are preceded by a zero.
    MM The two-digit month number. Single digit values are preceded by a zero.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: DTPicker.

    and really, those settings should be done at design time... rather than run-time.

    But that could be just me.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10

    Thread Starter
    Hyperactive Member Ram2Curious's Avatar
    Join Date
    Apr 2010
    Posts
    484

    Re: DTPicker.

    Thanks a lot!!! Problem solved!!!

    Thank you Akhilesh, RhinoBull, LaVolpe and techgnome.....

    Thank you.....

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