环境:Win10、VS2017
一、新建WPF项目
2. WPF项目添加System.Windows.Forms和WindowsFormsIntegration引用
3. 编写WPF窗体代码
3.1. 头部添加引用
1 xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 2 xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
3.2. 内容引用WinForm控件
1 <wfi:WindowsFormsHost Width="180" Height="20"> 2 <wf:DateTimePicker Format="Custom" CustomFormat="yyyy/MM/dd HH:mm:ss"></wf:DateTimePicker> 3 </wfi:WindowsFormsHost>
4. 运行查看效果
标签:控件,WindowsFormsIntegration,Windows,System,Forms,wpf,WPF,winform From: https://www.cnblogs.com/resplendent/p/18540072