WPF方便的调用FarPoint

一、安装FarPoint

二、创建WPF项目

三、引用farpoint相关dll

四、引用winform的相关dll:

System.Windows.Forms.dll

五、引用winfrom与WPF的窗台整合dll

在这里插入图片描述所需dll截图

六、新建一个winfrom用户控件,使用farpoint创建一个表格

在这里插入图片描述
在这里插入图片描述
通过右键spread design可以直接使用farpoint编辑器
在这里插入图片描述

七、WPF窗体使用用户控件

XAML写法:

<Window x:Class="WpfFarPoint3._0.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfFarPoint3._0"
        xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
        xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid Name="gridParent">
        <wfi:WindowsFormsHost Name="windowsFormsHost1" >
            <local:ucWinFormFarPoint></local:ucWinFormFarPoint>
        </wfi:WindowsFormsHost>
    </Grid>
</Window>

记得写

xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 

使用用户控件时也可以后台这样用:

 ucWinFormFarPoint ucWinFormFarPoint = new ucWinFormFarPoint();
 windowsFormsHost1.Child = ucWinFormFarPoint;

这样既可以方便的在farpoint编辑器里修改样式,又可以在WPF中使用farpoint

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值