Solved

MDI border

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

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now