Hello Everyone, I have an MDI form which works fine. At startup the childform opens and its windowstate is maximized. In the childform I have a textbox but does not have a windowstate to maximize. How can I maximize the textbox with the childform?

This is my formload:

private void TextEditorForm_Load(object sender, EventArgs e)
        {
            ChildForm childOneForm = new ChildForm();
            childOneForm.MdiParent = this;
            childOneForm.Text = "Welcome " + DateTime.Now + ChildOneCounterInteger.ToString();
            childOneForm.Show();
            childOneForm.WindowState = FormWindowState.Maximized;
            
        }

The childform window opens in a maximized state, but how can I make the textbox to open with the childform?

Thanks for your response. Well appreciated.

>but how can I make the textbox to open with the childform?

Set Doc property of TextBox.

textBox1.Dock = System.Windows.Forms.DockStyle.Fill;

>but how can I make the textbox to open with the childform?

Set Doc property of TextBox.

textBox1.Dock = System.Windows.Forms.DockStyle.Fill;

Hello adatapost,
Thanks for your feedback that is it. Got it working. I am here looking at the other docking of four corners and forgot all about the dock to fill. Thanks again. I didn't know you could do it programmatically.

Desi Bravo

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.