李sir_Blog

博客园 首页 联系 订阅 管理

1.导包

在引用处添加System.Windows.Fotms和WindowsFormslntegration

2.xaml部分

在需要使用控件的页面添加引用

xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi ="clrnamespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
添加需要使用的winfrom控件

<wfi:WindowsFormsHost Width="180" Height="20">
   <wf:DateTimePicker Format="Custom" CustomFormat="yyyy/MM/dd HH:mm:ss"/>
</wfi:WindowsFormsHost>

 

posted on 2023-02-02 22:57  李sir  阅读(93)  评论(0)    收藏  举报