DatePicker messing up!-VBForums
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
    Fanatic Member Sitten Spynne's Avatar
    Join Date
    Aug 2010
    Posts
    654

    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
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: DatePicker messing up!

    Moved
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.