Private Sub btnDrawEllipse_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnDrawEllipse.Click
' Create a Graphics object representing
' the form's drawing surface.
Dim gr As Graphics = Me.CreateGraphics()
' Create a brush representing a "backward
' diagonal" fill using blue lines over
' a blank background.
Dim ellipse_brush As New HatchBrush( _
HatchStyle.BackwardDiagonal, _
Color.Blue, _
Me.BackColor)
' Fill the ellipse.
gr.FillEllipse(ellipse_brush, 0, 0, _
Me.ClientSize.Width, _
Me.ClientSize.Height)
' Make a pen representing a thick red line.
Dim ellipse_pen As New Pen(Color.Red, 5)
' Draw the ellipse.
gr.DrawEllipse(ellipse_pen, 0, 0, _
Me.ClientSize.Width, _
Me.ClientSize.Height)
End Sub
|