Microsoft Small Basic

The Colors Object

Modified: 2009/11/28 15:28 by 75.208.65.145 - Uncategorized
There are a couple of ways to use Colors in small basic.

Let's say we wanted to set the Color of the line drawn by the Tortoise to red.

One way would be to pass in the string "red"

Tortoise.SetPenColor("red")

An other way to do the exact same thing is to ask the Colors object for Red

Tortoise.SetPentColor(Colors.Red)

This is nice, because the help is there to assist you. You might not need that for "red" but what about

Tortoise.SetPentColor(Colors.SaddleBrown)

Colors also allows for things like Random Colors

Tortoise.SetPentColor(Colors.GetRandomColor())

Now, go make your programs beautiful!

ScrewTurn Wiki version 2.0.35. Some of the icons created by FamFamFam.