Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Unwanted bottom-border on a Flat button

$
0
0

Hello I have a simple button but it seems to contain bottom border. This seems to be linked in with my Panel2 Paint event (the button is inside panel2).

private void panel2_Paint(object sender, PaintEventArgs e)
{
    Graphics g = e.Graphics;

    g.DrawLine(Pens.Red,
        new Point(e.ClipRectangle.Left, e.ClipRectangle.Bottom - 1),
        new Point(e.ClipRectangle.Right - 1, e.ClipRectangle.Bottom - 1));
}

I did change the Pen color and that's how I knew it was somehow changing the style of Button1 too.

What can I do to fix this little issue? The border should be on panel2 ONLY!


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>