예제 #1
0
        public Panel()
        {
            InitializeComponent();

            // Create the ElementHost control for hosting the
            // WPF UserControl.
            ElementHost host = new ElementHost();
            host.Dock = DockStyle.Fill;

            // Create the WPF UserControl.
            _form = new ExplorerForm();

            // Assign the WPF UserControl to the ElementHost control's
            // Child property.
            host.Child = _form;

            // Add the ElementHost control to the form's
            // collection of child controls.
            this.Controls.Add(host);
        }
예제 #2
0
        public Panel()
        {
            InitializeComponent();

            // Create the ElementHost control for hosting the
            // WPF UserControl.
            ElementHost host = new ElementHost();

            host.Dock = DockStyle.Fill;

            // Create the WPF UserControl.
            _form = new ExplorerForm();

            // Assign the WPF UserControl to the ElementHost control's
            // Child property.
            host.Child = _form;

            // Add the ElementHost control to the form's
            // collection of child controls.
            this.Controls.Add(host);
        }