|
-
Nov 12th, 2009, 02:30 AM
#1
Thread Starter
Member
how to set datetimepicker default value to empty?
how to set datetimepicker default value to empty?
-
Nov 12th, 2009, 04:01 AM
#2
Re: how to set datetimepicker default value to empty?
This doesn't really have anything to do with databases so it doesn't belong in the Database forum.
If you're talking about a .NET DateTimePicker then it's not possible. The Value property of the DTP is type DateTime, which is a value type and not nullable. You can display a check box in the control and have an unchecked box indicate a null value, although the Value property will still contain a Date value. You can streamline things a bit by deriving your own class and adding the extra functionality. You'll find already made like that here.
-
Nov 12th, 2009, 08:53 AM
#3
Re: how to set datetimepicker default value to empty?
 Originally Posted by lye85
how to set datetimepicker default value to empty?
I don't think this can be done in VB6. You could, instead have a label control cover up the datetimepicker control which would make it appear blank.
What's your purpose in setting the default value to empty?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Jun 3rd, 2014, 11:51 AM
#4
Junior Member
Re: how to set datetimepicker default value to empty?
 Originally Posted by lye85
how to set datetimepicker default value to empty?
I have resolved the problem for myself. I created an empty text box control. if the date is the default date the textbox is visible is true, if it has a valid date visibility is false. If it starts with a default value "01/01/1900" the text box covers it with an empty box. If the empty text box gets focus the visibility is set to false and the pick calendar is visible.
Works good for me.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|