471,354 Members | 1,284 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Set Anchor on Mdi child

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.
--

JohnH
Jan 17 '06 #1
2 5076
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jh" <sp****@spamcentral.com> wrote in message
news:MP***********************@news.zen.co.uk...
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.
--

JohnH

Jan 17 '06 #2
jh
In article <#e**************@TK2MSFTNGP09.phx.gbl>,
mv*@spam.guard.caspershouse.com says...
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.

--
JohnH
Jan 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Daniele Baroncelli | last post: by
3 posts views Thread by A.C. Jetter | last post: by
1 post views Thread by bob bringas | last post: by
10 posts views Thread by Rotsey | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.