开发者

Windows Forms User Controls in WPF app

开发者 https://www.devze.com 2022-12-25 21:39 出处:网络
Could someone post a link to simple tutorial, which descri开发者_JAVA百科be how to use User Controls, created in Win Forms in WPF aplication\'s?

Could someone post a link to simple tutorial, which descri开发者_JAVA百科be how to use User Controls, created in Win Forms in WPF aplication's? Thank's a lot.


In a nutshell:

1.Add a reference in your WPF project to System.Windows.Forms and WindowsFormsIntegration 2.Add the namespace in your XAML:

xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"

3.Use the WindowsFormsHost tag to surround any WinForms controls you use:

<Grid> <WindowsFormsHost> <WinForms:DataGrid /> </WindowsFormsHost> </Grid>

4.Profit!

0

精彩评论

暂无评论...
验证码 换一张
取 消