Screen Saver
[ Programs ]
Another example of a Visual Basic program that you could modify is a screen saver. The screen saver on this page just uses some of Visual Basic's graphic methods.
About The Screen Saver
Download The Program
The screen saver offers several options of display. You can either have it show Circles, Dots (via the PSet Method), Lines, Boxes, the Pentagon, or Random.
The first thing the program does is set the form to the size of the screen that it covers the whole screen. To do this, it just sets the left and top properties of the form to 0 and the width and height properties to Screen.Width and Screen.Height. If the user pushes any button but o, the program will end. If the user pushes o then the Options form comes up. From this form, you can change what screen saver is active and how long till it clears the screen. If you want to show the Pentagon, you can also choose how many points it has and what color it is.

Circles - The circles option just uses the circle method to randomly place circles on the form with random colors and random sizes.

Dots - The dots uses the pset method to randomly place dots on the form with different colors.

Lines - The lines use the line method to put lines on the form with different colors.

Boxes - The boxes also use the line method but use the box option.

Pentagon - The pentagon is the only challenging code in this program. It randomly gets 5 points (or the number of points the user selected in the options) and draws a line in-between the points. Then, it moves the points in the direction they're supposed to be going until they hit a wall. Whenever a point hits a wall, it gets a new random speed.
Random - The random option just randomly picks a screen saver every time it clears the screen and then shows the new screen saver until it is time to clear the screen again.
To run the screen saver if you have Visual Basic on your computer (or the support files), you just need the small file SS.EXE. If that file won't run correctly, try the SS.ZIP (unzip and run Setup.Exe).