Set Anchor on Mdi child

  • Thread starter Thread starter jh
  • Start date Start date
J

jh

I am trying to create a simple mdi app with a form anchored down the
left of the main form. In this "menu button" form I will have various
buttons etc. (i.e. similar to lots of websites)

However i cannot seem to achieve this. I have created an mdi parent,
created another form and set its MdiParent property to the parent. In
the parents load() function i am doing this:

// Init the MenuBar
MenuBar menuBar = new MenuBar();
menuBar.MdiParent = this;
menuBar.Anchor = AnchorStyles.Left | AnchorStyles.Top |
AnchorStyles.Bottom;
menuBar.Show();


The anchor property doesn't seem to have any affect. Can anyone point me
in the right direction?
Thanks.
 
John,

The anchor property applies to controls hosted on a form, not a form
that is an MDI child.

What you need to do is have the child form resize itself in response to
the parent resizing.

Hope this helps.
 
John,

The anchor property applies to controls hosted on a form, not a form
that is an MDI child.

What you need to do is have the child form resize itself in response to
the parent resizing.

Hope this helps.
Thanks Nicholas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top