سلام بر برنامه نویسان عزیز با یه کد سی شارپ دیگه در خدمتتون هستم.امیدوارم که از این استفاده کافی رو ببرید.
//define LinearGradientBrush with Init Prop
//
LinearGradientBrush lgBrush = new LinearGradientBrush(this.ClientRectangle,
Color.White, Color.Blue,130);
//
// Define ColorBlend
//
ColorBlend cb = new ColorBlend(5); // 5 is count of color which sets to Brush
cb.Colors = new Color[] {Color.Red,Color.Blue,Color.Gold,Color.Black,Color.Brown,Color.Lime };
//define the point of each color
//all the Points must be between 0 and 1
// 0 and 1 should be exist in point collection
cb.Positions = new float[] {0.0f,0.2f,0.4f,0.6f,0.8f,1f };
// assign colorBlend to gardientBrush
//
LinearGradientBrush lgBrush = new LinearGradientBrush(this.ClientRectangle,
Color.White, Color.Blue,130);
//
// Define ColorBlend
//
ColorBlend cb = new ColorBlend(5); // 5 is count of color which sets to Brush
cb.Colors = new Color[] {Color.Red,Color.Blue,Color.Gold,Color.Black,Color.Brown,Color.Lime };
//define the point of each color
//all the Points must be between 0 and 1
// 0 and 1 should be exist in point collection
cb.Positions = new float[] {0.0f,0.2f,0.4f,0.6f,0.8f,1f };
// assign colorBlend to gardientBrush