[英]WPF control inside Winforms doesn't work?
I have a winforms application, I wanted to add a WPF checkbox to this application, so I followed these steps : 我有一个winforms应用程序,我想向该应用程序添加WPF复选框,因此我遵循以下步骤:
1- Right click on the project name, then choose Add->User Control 1-右键单击项目名称,然后选择“ 添加”->“用户控制”
2- I choose User Control (WPF) from the list 2-我从列表中选择用户控制(WPF)
3- I add a check box to the WPF designer 3-我向WPF设计器添加了一个复选框
4- I Build the application 4-我构建应用程序
The question : After adding an ElementHost to my Winforms App, and expand the Child property, I don't see any controls, There is only a message saying (Add a new or existing WPF control to begin) 问题:将ElementHost添加到Winforms应用程序中并展开Child属性后,我看不到任何控件,只有一条消息说(添加新的或现有的WPF控件开始)
What I'm doing wrong ? 我做错了什么?
Edit : I have also tried to add a reference to WindowsFormsIntegration but results are same 编辑:我也试图添加对WindowsFormsIntegration的引用,但结果是相同的
When you build the WPF user control, the control will be listed in the Toolbox. 当您构建WPF用户控件时,该控件将在“工具箱”中列出。 Drag the control to the element host. 将控件拖动到元素主机。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.