Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Redisplay MDI Child Form Collapse All
Subject Author Date
koikoi sige Dec 7, 2009 - 10:51 PM

Hi.



I redisplay MDI Child Form,,but getting OutOfMemoryException.

The message is "Error creating window handle".



Add Form1(Rename ParentForm) and Form2(Rename ChildForm).

Add button1 and button2 on the ParentForm.



a part of source code of ParentForm



    public partial class ParentForm : Form

    {

        ChildForm childForm1 = new ChildForm();

        ChildForm childForm2 = new ChildForm();


        public ParentForm()

        {

            InitializeComponent();

            this.IsMdiContainer = true;

            childForm1.MdiParent = this;

            childForm2.MdiParent = this;

            childForm1.Show();

            childForm2.Show();

        }


        private void button1_Click(object sender, EventArgs e)

        {

            childForm1.Show();

        }

        private void button2_Click(object sender, EventArgs e)

        {

            childForm2.Show();

        }

    }



a part of source code of ChildForm



    public partial class ChildForm : Form

    {

        void ChildForm_FormClosing(object sender, FormClosingEventArgs e)

        {

            if (e.Cancel == false)

            {

                e.Cancel = true;

                this.Visible = false;

            }

        }

    }



Run and Close ChildForm1 and ChildForm2.

Push the button2.



Result:

Error was displayed , saying that "Error creating window handle".



Thanks.

Technical Support Dec 8, 2009 - 12:12 PM

Thank you for the bug report. We reproduced it succesfully and will include the fix in the upcoming release.

koikoi sige Dec 7, 2009 - 11:17 PM

correction.



Add button1 and button2 on the ParentForm.

->Add button1 and button2 and "ribbon1" on the ParentForm.