I have this code that allows me to add some blending to my windows form:
public partial class Form1 : Form
{
protected override void OnPaintBackground(PaintEventArgs e)
{
using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle,
Color.White,
Color.Black,
LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
}
}
And this is the result:
By default, the "peak" of the blending of the two colors is right in the middle of the box. I want to adjust the code in such way that the "peak" of the blending occurs about 3/4 towards the top. Is it possible to change the point where the two colors start to blend?
Thank you in advance.

You can set
InterpolationColorsproperty of the brush to a suitableColorBlendfor example:Or for example another blend: