C# 如何从wpf互操作访问winforms数据?
我的解决方案中有两个项目C# 如何从wpf互操作访问winforms数据?,c#,wpf,winforms,winforms-interop,C#,Wpf,Winforms,Winforms Interop,我的解决方案中有两个项目 -WindowsFormsApplication8 -WpfControlLibrary1 我正在使用WPF Interoperability中的ElementHost从WpfControlLibrary1托管UserControl1 _________________________ Form1 - [] x | ------------------------- .......... | label1 | // label
-WindowsFormsApplication8
-WpfControlLibrary1
我正在使用WPF Interoperability中的ElementHost从WpfControlLibrary1托管UserControl1
_________________________
Form1 - [] x |
-------------------------
..........
| label1 | // label
..........
// elementHost1
// wpf control has one
// button and nothing else
____________
| |
| ClickMe1 |
|____________|
__________________________
现在,
你好
private void b单击(对象发送方,路由目标)
{
MessageBox.Show();//此msgbox
}
我希望“ThisMSGBox”显示label1的内容
我该怎么做?我更改了答案。本网站可用于两种方式:
@pipelinecache请发布一个没有它我简直无法理解的例子!!:)嗨,大卫,是的,我可以,只需要几分钟。等等。谢谢,我只希望我有更多的时间写博客。
<Canvas>
<Button Click="btnclick">hello</Button>
</Canvas>
private void btnclick(object sender, RoutedEventArgs e)
{
MessageBox.Show(); // this msgbox
}