Results 1 to 4 of 4

Thread: DatePicker messing up!

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    1

    DatePicker messing up!

    Hey there,

    I'm having issues with the DatePicker control. It's driven me nuts, so maybe y'all have seen this before and can help me out.

    So here's the problem: No matter what date I pick, it always returns today's date! Here's the code below, and a screenshot (for the non-believers!),
    Code:
            
    Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles cmdOK.Click
    
                MessageBox.Show(dtpDueDate.DisplayDate())
    
    End Sub
    I'm stumped! Please help me out,

    Kevin McKowski
    Attached Images Attached Images  

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

    Re: DatePicker messing up!

    The WPF forum is over here. I will ask a mod to move it for you as this question directly relates a specific WPF control and not a control from Windows Forms.

  3. #3
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: DatePicker messing up!

    DisplayDate is a confusing property... I think it's for situations where you want to preserve the user's selection but possibly display another date? Either way, its default value is Today (per documentation) and it isn't what you want. Use the SelectedDate property instead. This is spelled out clearly in the example in the documentation.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DatePicker messing up!

    Moved

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