1.添加引用
首先添加System.Windows.Forms和WindowsFormsIntegration两个引用
2.头部添加
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
3.编写时间控件
<wfi:WindowsFormsHost Width="100" Margin="106,0,297,284">
<wf:DateTimePicker x:Name="tpStartDate" Format="Custom" CustomFormat="yyyy/MM/dd"/>
</wfi:WindowsFormsHost>
<wfi:WindowsFormsHost Width="80" Margin="212,0,212,284">
<wf:DateTimePicker x:Name="tpStartTime" Format="Time" ShowUpDown="True" />
</wfi:WindowsFormsHost>
<wfi:WindowsFormsHost Wi