예제 #1
0
        private void MixedForm_Load(object sender, EventArgs e)
        {
            WPFWindowLibrary.UserControl1 control = new WPFWindowLibrary.UserControl1();

            // Create the ElementHost wrapper.
            ElementHost host = new ElementHost();

            host.Child = control;

            // Set the Location and Size explicitly, unless you are using
            // a layout container like FlowLayoutPanel or TableLayoutPanel,
            // or you are using docking.
            //host.Location = new Point(10, 10);
            host.Size = new Size(flowLayoutPanel1.Width, flowLayoutPanel1.Height);

            // Add the ElementHost to the form or another suitable container.
            flowLayoutPanel1.Controls.Add(host);
        }
예제 #2
0
        private void MixedForm_Load(object sender, EventArgs e)
        {
            WPFWindowLibrary.UserControl1 control = new WPFWindowLibrary.UserControl1();

            // Create the ElementHost wrapper.
            ElementHost host = new ElementHost();
            host.Child = control;

            // Set the Location and Size explicitly, unless you are using
            // a layout container like FlowLayoutPanel or TableLayoutPanel,
            // or you are using docking.
            //host.Location = new Point(10, 10);
            host.Size = new Size(flowLayoutPanel1.Width, flowLayoutPanel1.Height);

            // Add the ElementHost to the form or another suitable container.
            flowLayoutPanel1.Controls.Add(host);

        }