#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Posts
    12
    Rep Power
    0

    To reset the datetimepicker in vb.net


    i gave coding as following.....

    Private Sub button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button.Click

    datetimepicker1.Value =new

    End Sub

    here comes error as:

    Error 1 Type expected. C:\Documents and Settings\Din\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.vb 29 23 WindowsApplication1
  2. #2
  3. Humble Learner
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    Bangalore, India
    Posts
    280
    Rep Power
    120
    What is that new in your code ?

    new what ?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Posts
    12
    Rep Power
    0
    i think i got the answer.... I give below the coding,

    datetimepicker1.ResetText()

    when the reset button is clicked the value of datetimepicker is reset to the current date
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by dinz
    i gave coding as following.....

    Private Sub button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button.Click

    datetimepicker1.Value =new

    End Sub

    here comes error as:

    Error 1 Type expected. C:\Documents and Settings\Din\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.vb 29 23 WindowsApplication1
    you can assign the value as string

    Dim idate As String
    idate = DateTimePicker1.Value

    csharp.net-informations.com/gui/cs-datetimepicker.htm

    gelin
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by winstongel
    you can assign the value as string

    Dim idate As String
    idate = DateTimePicker1.Value
    sharp.net-informations.com/gui/cs-datetimepicker.htm

    gelin
    i think i got the answer.... I give below the coding,

    datetimepicker1.ResetText()

    when the reset button is clicked the value of datetimepicker is reset to the current date
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    14
    Rep Power
    0
    hi gamin

    Here is my opinion

    Look at the check property of the the datetime picker. If check you use the date selected if not you ignore it

IMN logo majestic logo threadwatch logo seochat tools logo