Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

18 Experts available now in Live!

Get 1:1 Help Now