After reading this thread (http://tinyurl.com/3c6358) that I know WPF doesn't provide MonthCalendar control and DateTimePicker control, but I can use the Kevin's Bag-O-Tricks open source DateTimePicker control. After checking some books and websites, I found another way to use the MonthCalendar and DateTimePicker using WPF, it suggests me to add the "ElementHost" component and put the "WindowsFormHost" component into an instance of Elementhost, then we could use the MonthCalendar or DateTimePicker control, but I failed to do with it(I can't find the ElementHost component in ToolBox and I can't use the WindowsFormHost to contain the MonthCalender control). -------------------------------------------------------------------------- // Here's the code Expander expander = new Expander(); expander.Header = "WPF Header"; WindowsFormHost host = new WindowsFormHost(); host.Child = new MonthCalendar(); expander.Content = host; elementHost.Child = expander;
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" and then some in the code use it: <WindowsFormsHost Grid.Column="1"> <wf:WebBrowser x:Name="test" ScrollBarsEnabled="false"/> </WindowsFormsHost> "Fikret Huang" wrote: > After reading this thread (http://tinyurl.com/3c6358) that I know WPF doesn't > provide MonthCalendar control and DateTimePicker control, but I can use the > Kevin's Bag-O-Tricks open source DateTimePicker control. After checking some > books and websites, I found another way to use the MonthCalendar and > DateTimePicker using WPF, it suggests me to add the "ElementHost" component > and put the "WindowsFormHost" component into an instance of Elementhost, then > we could use the MonthCalendar or DateTimePicker control, but I failed to do > with it(I can't find the ElementHost component in ToolBox and I can't use the > WindowsFormHost to contain the MonthCalender control). > -------------------------------------------------------------------------- > // Here's the code > Expander expander = new Expander(); > expander.Header = "WPF Header"; > WindowsFormHost host = new WindowsFormHost(); > host.Child = new MonthCalendar(); > expander.Content = host; > elementHost.Child = expander;