
不过可以在WPF中嵌入WINFORM的图像控件PictureBox去做刷新。
嵌入方法:
1.在项目的References中加入WindowsFormsIntegration.dll和System.Windows.Form.dll
2.在页面的WPF中加入
[csharp] view plain copy
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integrationassembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Formsassembly=System.Windows.Forms"
比如
[csharp] view plain copy
x:Class="WpfApplication1.MainWindow"
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integrationassembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Formsassembly=System.Windows.Forms"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
title="MainWindow" Height="800" Width="1280" MouseMove="Window_MouseMove" MouseLeftButtonUp="Window_MouseLeftButtonUp" MouseDown="Window_MouseDown" MouseLeftButtonDown="Window_MouseLeftButtonDown">
然后我在Gridzhong 放下图像控件
[csharp] view plain copy
<Grid HorizontalAlignment="Left" Height="482" Margin="6,6,0,0" VerticalAlignment="Top" Width="737">
<wfi:WindowsFormsHost>
<wf:PictureBox x:Name="Cv_Main" Margin="0,0,0,0"></wf:PictureBox>
</wfi:WindowsFormsHost>
</Grid>
大功告成
有空的话就帮你写了,我以前做过在wpf中使用winform中的控件,其间也看到了在winform中使用wpf控件的文章,不过费点劲。不知道你是不是这个意思。如果你说的windows窗口也是wpf写的话那用delegate和event就可以把任何你想要的东西以参数形式回传给父窗体,父窗体在new完了注册事件就行了。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)