|
-
Dec 4th, 2007, 07:53 PM
#1
Thread Starter
Addicted Member
[RESOLVED] DateTimePicker Question
How do I make having a value in the DateTimePicker optional, i.e. I don't want there to be a default value. Is this possible?
-
Dec 4th, 2007, 08:17 PM
#2
Re: DateTimePicker Question
You mean like not having a date?
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 
-
Dec 4th, 2007, 08:44 PM
#3
Re: DateTimePicker Question
Normally you set the ShowCheckBox property to True and use the Checked property to indicate whether there's a value or not. You can also set the CustomFormat to a single space to blank the control's text.
-
Dec 4th, 2007, 08:46 PM
#4
Re: DateTimePicker Question
Yes, if thats what he means by no default date.
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 
-
Dec 5th, 2007, 01:44 AM
#5
Thread Starter
Addicted Member
Re: DateTimePicker Question
Sorry, not enough info I guess. I want to have a CustomFormat specified to enforce a certain format if a date is selected. But I don't want to have a value when the form first loads. To give you some context, I have 10 DateTimePickers for users to select when they started lunch, finished lunch, started supper, finished supper, etc., etc.. Sometimes they don't take lunch so they don't put a value in that field. So by default I don't want values in the fields but they can pick a date when needed.
I don't see a "ShowTextBox" property.
Thanks for your help.
-
Dec 5th, 2007, 05:16 AM
#6
Re: DateTimePicker Question
Set the Format to Custom. Then set the CustomFormat property to a space. Then change the customformat and format properties upon the first selection back to what you need.
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 
-
Dec 5th, 2007, 11:11 AM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] DateTimePicker Question
Marked this thread resolved to quickly. It doesn't work because the mindate and maxdate prevent you from putting anything other than a valid date in the value field.
Dozens of custom nullable datetimepicker controls have been written. I guess that is the only option.
-
Dec 5th, 2007, 11:13 AM
#8
Re: [RESOLVED] DateTimePicker Question
In your form_load event you could nullify the dtp. Then upon first closeup or lostfocus you can change the style back to what you were using.
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
|