Solved

MDI border

Posted on 2014-02-23
8
403 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

840 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