none
Get selected value from DateTimePicker RRS feed

  • Question

  • I would like to get selected value from DateTimePicker in VB (If I select only day value then I would like to get only selected day value.)

    In the case of textbox i can get selected value using

        TextEndTime.SelectedText

    Is there any syntax or approach to get selected value from datetime picker? Thanks in advance.

    Friday, August 31, 2018 8:01 AM

All replies

  • Hi,


    Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged
            TextBox1.Text = DateTimePicker1.Value
        End Sub

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 31, 2018 8:25 AM
  • There are several choices in regards to the .To methods.

    Using Value is not acceptable


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, August 31, 2018 10:40 AM
    Moderator