Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

390 Part III Designing the User Interface



  1. Click the Set Opacity button.


Notice how you can see through the form, as shown here:


  1. Click the Restore button.


The transparency effect is removed.


  1. When you’re done testing the transparency effect, click the Close button to quit the
    program.
    The program stops, and the development environment returns.


Chapter 15 Quick Reference


To Do This
Create lines or shapes
on a form

Use methods in the System.Drawing.Graphics namespace. For example,
the following program statements draw a red ellipse on the form:
Dim GraphicsFun As Graphics
GraphicsFun = Me.CreateGraphics
Dim PenColor As New Pen(System.Drawing.Color.Red)
GraphicsFun.DrawEllipse(PenColor, 10, 120, 200, 160)
Create lines or shapes
that persist on the form
during window redraws

Place the graphics methods in the Paint event procedure for the form.
Free download pdf