Datetime Picker - empty date ? |
Post Reply |
Author | |
stuc
Groupie Joined: 05 May 2011 Status: Offline Points: 20 |
Post Options
Thanks(0)
Posted: 12 August 2011 at 9:16am |
I'd like to use the datetimepicker as a data entry field but the users must be able to leave the date empty? Can this be done ? |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Yes it can, use the Custom setting that way you can then set the date field as blank. I am not in the office so can't post a code snippet, however if nobody else does I will post it on Monday morning.
|
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi,
I found a piece of code I had posted a while back in the Controls forum on this.
|
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
stuc
Groupie Joined: 05 May 2011 Status: Offline Points: 20 |
Post Options
Thanks(0)
|
Thanks fo rthe reply. This works ok for when the field is first on the screen but I cant trap the delete key for when the user wants to delete the date. I dont really want to have to put a "delete" button on screen to clear the field. |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi stuc,
Yeah I know about the lack of the keydown, keypress & keyup on the DateTimePicker. I rarely use it due to the way it skins (you can't see the day text clearly in some instances). However as a workaround why don't you try this:
Set the timer to be 100 milliseconds, it's crude but works well. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
stuc
Groupie Joined: 05 May 2011 Status: Offline Points: 20 |
Post Options
Thanks(0)
|
Thanks, that works but im using it in a form that has several instances of it plus a host of other controls. I'll fallback to my usual date picker I think. |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Yeah I can understand why you will be best falling back to your usual date picker.
Personally I use the DTPicker from the "Microsoft Windows Common Controls-2 6.0 (SP6)" for the reasons I said above, which can be seen in my other post: http://forum.codejock.com/forum_posts.asp?TID=17827 |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |