Question

Using 3 nested SplitContainers in my Windows Forms Application. When encountered the same problem that other have with the splitter bar being the same color as the surrounding panels. The common solution seems to be to change the BackColor but when nesting this results in an unsightly border around the nested panels:

Form with borders around the containers in the SplitContainer

I've also people suggesting the use of the Fixed3D BorderStyle but this has the same problem:

Form using 3DBorders that has a similar problem.

Was it helpful?

Solution

In the last moments of writing this question I had an epiphany. The dotted lines inside the SplitContainer are just guidelines and not a fixed margin. The location of the nested SplitContainer is 3, 3.

By manually setting the location to 0, 0 (the designer snaps to 3, 3) the grey on the left disappeared. I also had to enlarge it by 3 pixels to prevent a new border on the right.

Doing this to each nested SplitContainer solved my problem: Fixed form http://fr33dan.com/Fixed.png

OTHER TIPS

Give the splitcontainers different backcolors than their panels AND set the borderstyles of them all to None.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top