I want to create a Windows form with gradient background. So I use the code below to do this. And it works!
Dim frmIn as Form
Dim g As Graphics = frmIn.CreateGraphics
Dim x As Integer = frmIn.Width
Dim y As Integer = frmIn.Height
Dim lgBrush As New LinearGradientBrush( _
New Point(0, 0), New Point(x, y), _
Color.White, Color.LightGreen)
g.FillRectangle(lgBrush, 0, 0, x, y)
However, when I placed controls (like Label) onto the form, the background of the control do not match the background color and it becomes ugly. I tried to set the background color of the controls to "
transparent" but seems like nothing change.
Please help!
Eins Tsang