Solved

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

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
Crystal reports login after closing form 3 34
Asp.Net Session Question 2 33
how to remove error in database 6 28
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…

740 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