17-10-12, 05:31 PM
كاتب الموضوع : AhmedEssawy
كود :
'In the Form_Paint event. Put the following code
Dim rec As Rectangle = New Rectangle(0, 0, Me.Width, Me.Height) 'create a new recatangle
'Create a new brush. Make is a Gradient style brush.
Dim myBrush As Brush = New Drawing.Drawing2D.LinearGradientBrush(rec, Color.Aqua, Color.Yellow, _
Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal)
'draw the gradient onto the form.
e.Graphics.FillRectangle(myBrush, rec)