Solved

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

Posted on 2013-01-08
4
1,852 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 85

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 85

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now