Results 1 to 5 of 5

Thread: Date Time Picker Troubles (RESOLVED)

  1. #1

    Thread Starter
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142

    Date Time Picker Troubles (RESOLVED)

    Okay, I have a program I'm writing for a friend. There is a form to add a new record to a file. At the bottom of this form are three date-time-pickers. These are generally the last things a user will change on this form. Next to each DTP is a label that shows a date after the date selected in the DTP. I want the label to update after the user picks a date on the accompanying DTP.

    What event should I use to trigger that?

    What I want, is that the label will update only after a date has been picked, so dtpDate.Valuedchanged is no good, because then the label updates with each click. dtpDate.Validating is no good either because you have to focus on something else to activate it, and as I said, the user is done clicking things by this point, so the last label never gets updated.

    Any suggestions?
    Last edited by The Phoenix; Aug 24th, 2003 at 11:20 PM.
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try :
    VB Code:
    1. Private Sub DateTimePicker1_TextChanged(ByVal sender As
    2. Object, ByVal e As System.EventArgs) Handles
    3. DateTimePicker1.TextChanged
    4.  
    5.         Label1.Text = DateTimePicker1.Value
    6.  
    7. End Sub

  3. #3

    Thread Starter
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142
    Aw, Geez. I really should have seen that.

    Thanks. I'm glad you guys are friendly to newbies, cause I sure give you all reason to yell at us newbs for our stupidity.
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

  5. #5

    Thread Starter
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142
    Actually, that doesent really work for me either. What I do with the labels is this: The DTP is a date of the last time you gave your dog its shots. The label is the next time the dog is due for shots. If it's overdue, I showa message box. So, if I use TextChanged, and say the shots were 3 years ago, the dumb message box keeps popping up as you go backward through the DTP.

    However, this time I managed to avoid sounding like a complete nOOb, and found the solution myself: the CloseUP event!

    Thanks for the help though, Pirate!
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

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