Results 1 to 4 of 4

Thread: Calendar dates

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    4
    Hi,

    I know that dates have been mentioned on the message board but I can't seem to get a handle on them.

    I am using the standard calendar control that is shipped with vb6 and would like to make it so that the month, year and day are the same as the windows date when loaded.

    Any help would be greatly appreciated.


    Regards,
    Anthony Irwin

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    try this way.

    Code:
    'DTPicker Control
    Private Sub Form_Load()
        DTPicker1.Value = Date
    End Sub
    
    
    'Calendar Control
    Private Sub Form_Load()
        Calendar1.Value = Date
    End Sub
    
    'MonthView Control
    Private Sub Form_GotFocus()
        MonthView1.Value = Date
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    4
    Thanks Chris,

    I was tring to do api calls to windows to get the date and break it down into year, month and day to set in manualy.

    you saved me hours of development time, and there was only one line of code required, silly me.
    Regards,
    Anthony Irwin

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    irwa82, sometimes we might overlook the solution for some easy problem too.

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