Solved

MDI border

Posted on 2014-02-23
8
407 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
Industry Leaders: 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!

 

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes

728 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