简体   繁体   中英

C# Remove SplitContainer border?

在此输入图像描述在此输入图像描述

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 :\\

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

在此输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM