Colors

So far, we've been drawing the ellipse in our form using a built-in dark blue brush. A brush, as you'll see, is for filling the interior of a shape, whereas a pen is used to draw the edge of a shape. Either way, suppose we're not quite happy with the dark blue brush. Instead, we'd like a brush of one of the more than 16 million colors that doesn't come prebuilt for us, and this means that we first need to specify the color in which we're interested. Color is modeled in .NET via the Color structure:

 Structure Color ' No color Public Shared ReadOnly Empty As Color ' Built-in colors Public Shared AliceBlue As Color ' ... Public Shared YellowGreen As Color ' Properties Property A() As Byte Property B() As Byte Property G() As Byte Property ...

Get Windows Forms Programming in Visual Basic .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.