A
A
Anton2018-04-19 00:33:35
C++ / C#
Anton, 2018-04-19 00:33:35

Why doesn't it paint the button with a gradient?

protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            this.Paint += FlatButton_Paint;
            using (LinearGradientBrush linGrBrush = new LinearGradientBrush(new Point(borderRectangle.Left), new Point( borderRectangle.Right), Color.FromArgb(255, 248, 140, 17), Color.FromArgb(255, 241, 99, 21)))
            {
              e.Graphics.FillRectangles(linGrBrush);
            }
        }

I need the created button to be filled with a gradient, but for some reason it gives an error, what's the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
l1l1l1, 2018-04-19
@Toxa26

What error appears?
Perhaps you need to pass 2 parameters to the FillRectangles function ?
https://msdn.microsoft.com/en-us/library/5c3h7524(...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question