0
我的问题是我想使用WPF扩展器对象来托管一些winforms控件。我要使用的位置在我的应用程序的设置窗体中。但是,我找不到的是向它添加多个控件。在带有多个控件的Winforms中使用WPF扩展器
经过大量寻找解决我的问题,我刚刚发现这个简单的代码,只有一个控件添加到WPF扩展对象(我需要一个以上的控制添加):
private void Form1_Load(object sender, EventArgs e)
{
System.Windows.Controls.Expander expander = new System.Windows.Controls.Expander();
expander.Header = "Sample";
WPFHost = new ElementHost();
WPFHost.Dock = DockStyle.Fill;
WindowsFormsHost host = new WindowsFormsHost();
host.Child = new DateTimePicker();
expander.Content = host;
WPFHost.Child = expander;
this.Controls.Add(WPFHost);
}
在此代码扩展器只托管一个控件。
我应该如何定制它来托管多个控件? 请帮助
非常感谢。 @Alexey – 2014-10-02 05:20:44