WPF如何创建时间控件?
2个回答
展开全部
使用嵌套WinForm控件可以实现,参考代码如下:
引用WindowsFormsIntegration
页首:
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<wfi:WindowsFormsHost Width="90" >
<wf:DateTimePicker x:Name="tpStartDate" Format="Custom" ShowUpDown="True" />
</wfi:WindowsFormsHost>
<wfi:WindowsFormsHost Width="80">
<wf:DateTimePicker x:Name="tpStartTime" Format="Time" ShowUpDown="True" />
</wfi:WindowsFormsHost>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
使用嵌套WinForm控件可以实现,参考代码如下:
引用WindowsFormsIntegration
页首:
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<wfi:WindowsFormsHost Width="90" >
<wf:DateTimePicker x:Name="tpStartDate" Format="Custom" ShowUpDown="True" />
</wfi:WindowsFormsHost>
<wfi:WindowsFormsHost Width="80">
<wf:DateTimePicker x:Name="tpStartTime" Format="Time" ShowUpDown="True" />
</wfi:WindowsFormsHost>
引用WindowsFormsIntegration
页首:
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<wfi:WindowsFormsHost Width="90" >
<wf:DateTimePicker x:Name="tpStartDate" Format="Custom" ShowUpDown="True" />
</wfi:WindowsFormsHost>
<wfi:WindowsFormsHost Width="80">
<wf:DateTimePicker x:Name="tpStartTime" Format="Time" ShowUpDown="True" />
</wfi:WindowsFormsHost>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询