MDI Parent Text

1 Answer 68 Views
Form
Paul Dell
Top achievements
Rank 1
Iron
Paul Dell asked on 01 Sep 2022, 12:16 PM

Hello,

i am using the mdi functionality in my winforms app. If i open a childform in maximized state, the text of the childform will appear in the text of the parent mdi form. How can i disable this so that the text of the parent mdi form will always stay the same?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Sep 2022, 05:20 AM
Hello, Paul, 

I would like to note that the standard MS Form behaves in a similar way in a MDI scenario:

The parent form's text is changed when the MDI child is maximized.

Feel free to use Stackoverflow and MSDN for general programming questions like this.

However, I have prepared a sample code snippet for your reference demonstrating how to manage the text of the MDI parent when the child is maximized:

        public Form1()
        {
            InitializeComponent();

            this.IsMdiContainer = true;
            Form f = new Form();
            f.SizeChanged+=f_SizeChanged;
            f.Text = "Child";
            f.MdiParent = this;
            f.Show();
        }

        private void f_SizeChanged(object sender, EventArgs e)
        {
            Form f = sender as Form;
            if (f.WindowState == FormWindowState.Maximized)
            {
                f.Text = "";
            }
            else
            {
                f.Text = "Child";
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Form
Asked by
Paul Dell
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or