Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Remove SplitContainer border?

Tags:

c#

winforms

enter image description hereenter image description here

Hi, How can I remove the border that surrounds the splitcontainer.panel? As you can see in the picture the left is executed and the right VS. The panel have dock.left programmatically and form backcolor is the same as panel therefore I believe that is the border. I've tried some code but don´t work including this but only work on tabcontrol:

    protected override void WndProc(ref Message m)
    {
    // Hide the tab headers at run-time
    if (m.Msg == 0x1328 && !DesignMode)
    {
        m.Result = (IntPtr)1;
        return;
    }

    // call the base class implementation
    base.WndProc(ref m);
    }

how can I hide this border? hlp pls :\

like image 251
Luis Granado Avatar asked Nov 02 '22 06:11

Luis Granado


1 Answers

I'll try to answer, though I have win7.

On picture below you have typical SplitContainer. It consists of:

  • SplitContainer backcolor;
  • Panel 1 backcolor
  • Panel 2 backcolor
  • parent container backcolor

enter image description here

On your screenshot you are editing form and in the designer mode you can see stroked lines which are representing panel margins. I have them too. It's ok.

What is not ok, is the left part of your screenshot. Suddenly your form is inside of something. This something cause this effect. I could think of either something has Padding (not 0;0;0;0) or your form has Margin (not 0;0;0;0) or perhaps it is some glitch, when, to example, you have your form embedded into something (another form), due to non-client region being not-painted or whatever else.

Edit

Try to set colors explicitly (set some crazy colors, like I did) for: splitcontainer, panel1, panel2 and parent container (whatever it is). Then post a screenshot. I am pretty sure once you do it, you will see a problem.

like image 112
Sinatr Avatar answered Nov 12 '22 20:11

Sinatr