Having Fun with Visual Basic

Once you understand how to make a button on a form, and how to write text on a form, there are a couple of easy, fun things you can try to make entertaining programs.

It's easy to add any picture to your Visual Basic program. Just click on the picture icon (), then draw a place for your picture on the form.

It will be blank at first, so change the Image property of the image, by clicking on the "..." button in the Properties (See figure on right).

When someone clicks on one of your program's buttons, you can have the program say anything you want to.  In design mode, just double-click on the button, and the code window will appear.  From there, you can type the MsgBox command, and enter whatever text you want as the message that appears when they click. It looks like this:

This figure also shows three different tabs to help you navigate between different views of your project.  In the above figure, they're labeled "Start Page", "Form1.vb [Design]*", and "Form1.vb*".  Just click on those words to switch between the different views.  Also: the * means that this project has not yet been saved.

You can also have make the button move before the person can click on it.  So you could have a "survey", where the user is forced to choose a certain answer, because the other answer is un-clickable.  To do this, double-click on a button in design mode, to open up it's code window:

Then (1) Change the pull-down menu on the right to MouseMove. This will make the code happen whenever the mouse is moved over the button.  Next, type in the code you see above, except that maybe your command is named something different than Button1.  Just use whatever name you see selected in the upper left pull-down menu.