简体   繁体   English

如何从WPF控件访问Windows窗体控件?

[英]How to access windows form controls from WPF control?

I need to show a control in a form according to an event in a WPF control. 我需要根据WPF控件中的事件以表格形式显示控件。

TheBoard theBoard = new TheBoard();
theBoard.keyboard.Visible = true;

even if I write: 即使我写:

theBoard.Close();

nothing will happen, if anybody can give me a solution please. 如果有人可以给我解决方案,什么都不会发生。

You could raise an event from WPF control and subscribe that event in Windows form control. 您可以从WPF控件引发一个事件,然后在Windows窗体控件中订阅该事件。 Here is a link which could give you the way to go. 这是一个链接,可以为您提供帮助。

http://www.a2zdotnet.com/View.aspx?Id=79#.T46J5bN-WUI http://www.a2zdotnet.com/View.aspx?Id=79#.T46J5bN-WUI

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问windows窗体中的控件显示事件? - How to access controls in windows form shown event? 如何在另一个类中访问Windows窗体控件 - How to access Windows form controls in another class 如何从后台线程访问WPF控件 - How to access WPF controls from a background thread 如何从用户控件访问页面控件? - How to access page controls from user control? 如何将“System.Windows.Controls.TextBlock”转换为“System.Windows.Controls.Control”WPF3DFD74EFA19FBEZA23 - How to convert 'System.Windows.Controls.TextBlock' to 'System.Windows.Controls.Control' WPF C# 如何从表单控件访问表单实例 - How to access form instance from form controls 无法在WPF中将System.windows.Controls.Image隐式转换为System.windows.form.control - Can't implicitly convert System.windows.Controls.Image into System.windows.form.control in WPF 从 Windows 窗体中删除控件并调整其他控件以适应 - Removing a control from Windows Form and adjusting other controls to fit 当我使用Designer向表单添加新控件时,如何阻止visual studio更改WPF表单中控件的属性? - How to stop visual studio from changing properties of controls in WPF form when I add a new control to form using Designer? 如何在Infragistics Tab控件中找出Windows窗体控件? - How to find out windows form controls inside infragistics Tab Control?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM