Coffeehouse Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

C# MDI Form / Control Box

Back to Forum: Coffeehouse
  • User profile image

    I am aware this isn't a support forum, but if anyone knows it will be the engineers that made it... When I open a child form in an MDI parent the control box (maximize/minimize etc) appears in the top right corner, there's nothing you can do to stop it. I have set the properties to disable it but they don't appear to work in MDI mode.

  • User profile image

    Hey manip

    i'm not sure i understand the problem, could you post a repro maybe?

    when i put this code in the form load of an mdi parent in c#, i get a child that doesn't have a minimize or maximize box ( this is on vs/net 1.1 ).

    Form child = new Form();
    child.Text = "Child";
    child.MdiParent = this;
    child.MinimizeBox = false;
    child.MaximizeBox = false;
    child.Show(); <--this has no min/max buttons...

    so i'm guessing that's not what u are looking for?

  • User profile image

    Thanks for responding. Smiley

    My code is identical to yours except mine uses a pre-made form (Form2). Still shows the control box(s).

    Form2 form2 = new Form2();
    form2.MdiParent = this;
    form2.ControlBox = false;
    form2.MinimizeBox = false;
    form2.MaximizeBox = false;

  • User profile image
    spod for me ( i get no control box ). Form2's ctor doesn't set its size to be maximized does it...?

    from the msdn help for Form.ControlBox:

    Note When set to false, the ControlBox property has no effect on a Multiple Document Interface (MDI) child form that is displayed maximized at time of creation.

    this is on 1.1, i haven't tried on v 1.0 of the framework...

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.