|
-
Aug 8th, 2009, 10:51 AM
#1
Thread Starter
Addicted Member
Programmatically Open Datetimepicker
Does anyone know of a way to "Open" (like when you click on it and get the dropdown) the datetimepicker? My goal is to have it open when focus is set to the control. Any ideas?
-
Aug 9th, 2009, 01:12 AM
#2
Hyperactive Member
Re: Programmatically Open Datetimepicker
You could use the raiseevent method I believe. I havent tested this but its just an example:
Code:
Button myButton = new Button();
myButton.RaiseEvent(new RoutedEventArgs(Button.Click, myButton));
Another way is the datepicker has a IsDropDownOpen property that you could set on the gotfocus method.
A different method would be taking the date picker and editing its template. Then you could create trigger that set its IsDropDownOpen property on gotfocus.
If you have any questions just ask.
If I helped you please rate me.
-
Aug 9th, 2009, 07:01 AM
#3
Re: Programmatically Open Datetimepicker
I didnt think there was a WPF DateTimePicker ? Or are you talking about the winforms version? (not sure why you posted it in the WPF forum if thats the case)
-
Aug 9th, 2009, 11:00 AM
#4
Hyperactive Member
Re: Programmatically Open Datetimepicker
I didnt see a DateTimePicker in my Toolbox but there is a DatePicker that was added in June(I believe). You can get the latest wpf toolkit here. I just assumed that was what he was talking about.
If I helped you please rate me.
-
Sep 3rd, 2009, 02:10 PM
#5
Re: Programmatically Open Datetimepicker
Although this is a VB6 technique, you could use the same logic in WPF to do the same thing.
http://www.vbforums.com/showthread.php?t=251933
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
|