Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-01-08
4
Medium Priority
?
2,103 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
  • 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 600 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

782 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