We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Gradient color

How to set gradient color (slides from blue to white) to the datagrid's caption and column headers? Does anyone know how to make this?

1 Reply

JS Jayaprakasan Subramaniam April 17, 2004 11:31 AM UTC

Override the paint method of DataGrid Code: Graphics dc=e.Graphics; if(e.ClipRectangle.Top <132 && e.ClipRectangle.Left <82) { Pen BluePen=new Pen(Color.Blue,1); Rectangle r=new Rectangle(0,0,this.Width,this.Height); Color Cl=Color.FromArgb(219,220,220); LinearGradientBrush Br=new LinearGradientBrush(r,Color.White,Cl,LinearGradientMode.Vertical); e.Graphics.FillRectangle(Br,r); } base.OnPaint(e); >How to set gradient color (slides from blue to white) to the datagrid''s caption and column headers? Does anyone know how to make this? > > >

Loader.
Live Chat Icon For mobile
Up arrow icon