Solved

Hide/Delete control box of MDI Child in VB.Net

Posted on 2013-01-08
4
2,005 Views
Last Modified: 2013-01-23
I have a project in vb.net with 2 forms.  One is a Parent MDI form with one child MDI form.  I am able to open the child form within the parent form however the control box of the child is showing as you can see on the attached document.  I need for my child not to have that and just share the MDI parent control box.  Is this possible?
MDI-Child-ControlBox.doc
0
Comment
Question by:mhopeman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38756198
Just set child form's ControlBox property to false either programmatically when showing or at design time.


http://msdn.microsoft.com/en-us/library/system.windows.forms.form.controlbox.aspx
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 200 total points
ID: 38756373
You don't really need the MDI model then...

Another approach is to display your "child" form directly within the main one as a borderless form with either Dock set to Fill, or WindowState to Maximized.  You must first set the TopLevel() property of the child form to False, however:

    Dim child As New frmChild
    child.TopLevel = False
    child.FormBorderStyle = FormBorderStyle.None
    child.Dock = DockStyle.Fill
    Me.Controls.Add(child)
    child.Show()

The child can be displayed in a different container, such as a Panel, by replacing "Me" with the appropriate name, like "Panel1".
0
 

Author Closing Comment

by:mhopeman
ID: 38811522
This works but I was looking for another answer without having to display in a panel on another object.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 38811612
It doesn't have to be in a Panel.

In my example, the child form is being contained directly by the main form itself:

        Me.Controls.Add(child)

The "Me" is the Main Form.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question