none
How to get rid of the divider line of a "StatusStrip" RRS feed

  • Question

  • Is there a way to change the color of the divider line (drawn in white as below) of a StatusStrip?

    Well, somehow I can't attach the screenshot of the form but you can test like, say;

    - the `Form` background is set to "#2f4f8f",

    - the `StatusStrip` background is set to "#1f2f4f",

    - a `Label` with background "#2f4f8f" and foreground "#cfcfcf" is added...

    - and a "white" divider line appears between the `StatusStrip` and the `Form`.

    A test code is added below:

    using System;
    using System.Drawing;
    using System.Windows.Forms;
    
    class Program {
        static void Main() {
            FormMain FormMain = new FormMain();
            Application.Run(FormMain);
        }
    }
    
    class FormMain : Form {
        StatusStrip statusStripTest;
        ToolStripStatusLabel labelTest;
    
        public FormMain() {
            this.BackColor = ColorTranslator.FromHtml("#2f4f8f");
    
            this.statusStripTest = new StatusStrip {
                BackColor = ColorTranslator.FromHtml("#1f2f4f")
            };
    
            this.labelTest = new ToolStripStatusLabel ("testing...") {
                BackColor = ColorTranslator.FromHtml("#2f4f8f"),
                ForeColor = ColorTranslator.FromHtml("#cfcfcf")
            };
    
            this.statusStripTest.Items.Add(this.labelTest);
            this.Controls.Add(this.statusStripTest);
        }
    }
    


    • Edited by merkez3110_ssd Tuesday, September 24, 2019 7:10 PM small change in the code
    Tuesday, September 24, 2019 6:30 PM

Answers

  • Hi merkez3110_ssd,

    Thank you for posting here.

    If you want to get rid of the divider line of a "StatusStrip", you could try to use the following code.

    class Program {
        static void Main() {
            Application.EnableVisualStyles();
            FormMain FormMain = new FormMain();
            Application.Run(FormMain);
        }
    }

    Result:

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by merkez3110_ssd Wednesday, September 25, 2019 4:55 AM
    Wednesday, September 25, 2019 1:51 AM
    Moderator

All replies

  • Hi merkez3110_ssd,

    Thank you for posting here.

    If you want to get rid of the divider line of a "StatusStrip", you could try to use the following code.

    class Program {
        static void Main() {
            Application.EnableVisualStyles();
            FormMain FormMain = new FormMain();
            Application.Run(FormMain);
        }
    }

    Result:

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by merkez3110_ssd Wednesday, September 25, 2019 4:55 AM
    Wednesday, September 25, 2019 1:51 AM
    Moderator
  • Perfect! Thanks a lot.
    Wednesday, September 25, 2019 4:57 AM