Small Basic – How to change the thickness and color of your lines

First of all, drop in this code to draw a line:


GraphicsWindow.Title    = "Line Time"



If you want to change the thickness or color of the line, use the PenWidth and PenColor properties of the GraphicsWindow object. For example, to draw with a thicker, green pen, update your program like this:


GraphicsWindow.Title    = "Lime Time"

GraphicsWindow.PenWidth = 3        'Try different numbers

GraphicsWindow.PenColor = "Green"  'Try different colors


'Continue your program


After you make that change, run your program again to see what’s different. Now experiment with some colors and different pen widths!

All the colors are listed here:

Small Basic Getting Started Guide: Appendix B: Colors


Have a Small and Basic week!

   - User Ed & Majed Marji

Comments (1)
  1. Computers Today (part 1 of 6)…/computers-today.aspx


    CS SPOTLIGHT: Girls in computer programming… why it matters!!!…/cs-spotlight-girls-in-computer-programming-why-it-matters.aspx

    Computational Thinking – Videos & Papers by Jeannette Wing…/computational-thinking-videos-amp-papers-by-jeannette-wing.aspx

Comments are closed.

Skip to main content