Solved

MDI border

Posted on 2014-02-23
8
400 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Store results in vb.net 3 20
Database Connections Not being returned to Connection Pool 7 25
Help with exporting to excel 4 27
Send SMS from VB via Sierra Wireless Modem 2 21
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.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

770 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