Solved

MDI border

Posted on 2014-02-23
8
404 Views
Last Modified: 2014-02-23
Hello,

Im trying to remove borders from my MDI Container, after a search around I found this code. However, I need some advise on a small issue. The problem I have is that My MDI Container has a Panel, Status Bar, Tool Strip and Menu Strip. The issue is that this is not taken into account and the contents of the form is all over the place and Im not sure on what to do.

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

Open in new window

0
Comment
Question by:lincstech
[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
  • 4
  • 4
8 Comments
 
LVL 40
ID: 39881018
Not exactly clear, a screenshot might help, but if I get it right:

f2.Dock = DockStyle.Fill

When  DockStyle is set to Fill, a control (and a form is a control) will take up all the available space Inside of its container. Do not care about the DockStyle and you might get what you are looking for.
0
 

Author Comment

by:lincstech
ID: 39881048
Okay so this is how the form looks
Error2
And this is what its like debugged
Error1
As you can see the other form consumes the whole thing

And this is taking your suggestion
Error3
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39881073
At first sight, its what I thought. The grey background you get when it runs in f2 form that fills the MDI because it's marked as being Docked.

From what I see of your design, you are trying to do something similar to Outlook, with some kind of selection bar the the left, and a place to display information on the right.

In such a situation, a MDI form is not the way to go.  What you need is to insert your f2 inside of the panel, not inside of the main Form, something similar to the following:

Dim f2 As New fm_dash
f2.Dock = DockStyle.Fill
f2.FormBorderStyle = FormBorderStyle.None
<YourPanel>.Controls.Add(f2)
f2.Show()
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:lincstech
ID: 39881090
I don't quite understand I am trying to achieve what you have outlined however, if I do what you've outlined if I'm correct which I doubt that but I get an error during debugging.
0
 
LVL 40
ID: 39881133
And what is the error. I cannot help you if I do not have the details.
0
 

Author Comment

by:lincstech
ID: 39881160
Error
That's what I get.
0
 
LVL 40
ID: 39881185
Look at the error window carefully when you get an error. The second paragraph in the error dialog, "Additional information", sometimes offer a good clue to the cause of the problem. It is doing so in your screenshot.

I did not test the code I sent you (I should have) and forgot the following line:

f2.TopLevel = False

This is needed when you want to treat a form as a standard control.

Sorry.
0
 

Author Closing Comment

by:lincstech
ID: 39881203
Excellent Thank you for your help
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.

761 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