473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 5253
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Daniele Baroncelli | last post by:
Hi guys, I would like to change the text in an anchor. es. from <a id="idanchor">oldtext</a> to
3
by: A.C. Jetter | last post by:
I am using C# in Visual Studio.Net to create an application. The problem I am having is when the main form is moved around on the screen, the "panel" form that is displayed on the tab control...
0
by: James | last post by:
I have a composite custom control which is constructed of several other controls, such as command buttons, a listview etc. I have several controls which border the boundary of the container and have...
1
by: bob bringas | last post by:
Hi there, I'm having trouble closing an anchor created with DOM methods. I am successfuly creating the anchor, and then giving it an img for its child node, but for some reason, the anchor is...
3
by: bloc | last post by:
I am programming an interactive CV using xml, xslt and java script. The page consists of a header which contains links to various 'sections' on the xml cv, a left and right menu, and a central...
0
by: LudwigWrules | last post by:
I have an iframe on my site. I need the frame to display its "child" page at a specific point. I can do this by setting an anchor, but it makes the parent window go there, too. I was thinking of just...
2
by: TheITGuyFromNY | last post by:
To set this up, I have a parent window with a list of things (doesn't matter what they are, but they are loaded by the page dynamically from a database with ASP server-side script. So, next to each...
10
by: Rotsey | last post by:
Hi, I have a Listbox in a Panel of SplitContainer. I want to anchor it so the listbox grows/shrinks vertically with the resizing the splitcontainer. This is my code What happens is it...
8
by: azjudd | last post by:
Thank you in advance for your help on this one. I'm using named anchor tags on a FAQ page with questions listed at the top and answers below; a standard jump-to feature. However, anytime an anchor...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.