|
-
Nov 24th, 2007, 02:57 AM
#1
Thread Starter
Fanatic Member
how to set null value to dtp
how to set null value or empty value to datatimepicker at runtime
-
Nov 24th, 2007, 04:22 AM
#2
Re: how to set null value to dtp
 Originally Posted by karthikeyan
how to set null value or empty value to datatimepicker at runtime
Hi,
Well, the standard DateTimePicker does not support this feature,
however there are a lot of custom control which can support it.
http://www.codeproject.com/useritems/ketan.asp
http://www.codeproject.com/cs/miscctrl/Nullable_DateTimePicker.asp
http://www.codeproject.com/cs/miscct...timepicker.asp
Hope it helps,
sparrow1
-
Nov 24th, 2007, 05:00 AM
#3
Thread Starter
Fanatic Member
Re: how to set null value to dtp
-
Nov 24th, 2007, 05:03 AM
#4
Re: how to set null value to dtp
Yes, you can set it to null.
Set the ShowCheckbox property to True.
Then if Checked is True the value of the DTP will be whatever date is displayed.
If the Checked property is False tehn the Value property is Null.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 24th, 2007, 05:21 AM
#5
Re: how to set null value to dtp
Hi Rob,
I thought he was asking for a complete null value (empty datatimepicker).
With your suggestion the datatimepicker act like a enabled datatimepicker and you can still see the date.
Or am I wrong.
Wkr,
sparrow1
-
Nov 24th, 2007, 05:23 AM
#6
Re: how to set null value to dtp
Yes it will but you can also make it "empty" too so no date is displayed when the checkbox is unchecked.
Set a CustomFormat of a space char when its unchecked. Then set the format back to its previous setting/format when checked.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|