Results 1 to 2 of 2

Thread: DateTime and default value

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    DateTime and default value

    I have many classes that contain variables (and properties to access them) of type DateTime. However, when I access these properties in a form, and they are not initialized, the value shows up as 12:00.... I would like to show nothing or the empty string "".

    I guess I could compare in the UI saying if myClass.Date = New Date then txtbox.Text() = "". I could also add new properties (or replace the existing ones) that return the date values as strings and do the check in the property.

    This seems like alot of work just to get around this default date thing. Has anyone done it differently or have any ideas?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    That is just wierdness related to Date types I believe it was the same way in VB6. Just one note you may want to check its value again Date.MinValue so you don't have to create a new instance of Date to check if it has been used yet for not.

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