如何将用户控件添加到winforms中的选项卡控件以及如何在单击按钮上打开整个选项卡控件面板?
答案 0 :(得分:0)
在编辑问题之前:
使用System.Windows.Forms.Integration.Elementhost
。
MSDN
// Create the ElementHost control to host the WPF UserControl.
ElementHost WPFHost = new ElementHost();
WPFHost.Dock = DockStyle.Fill;
// Create the WPF UserControl.
HostingWpfUserControlInWf.UserControl1 uc = new HostingWpfUserControlInWf.UserControl1();
// Add the WPF UserControl to the Host.
WPFHost.Child = uc;
// Add the ElementHost to the form.
this.Controls.Add(WPFHost);