back


A Visual Basic Program to Turn Pictures On and Off with Buttons
  1. Create a new Visual Basic Project
  2. Click the picture icon on the toolbar and drag a picture box onto your form
  3. Click on the picture property and select a picture
  4. Change the visible property of the picture to false
  5. Click on the label icon of the toolbar
  6. Delete its caption from the caption property and give your picture a name
  7. Drag a command button onto the form
  8. Change its caption to: "on"
  9. Add another command button. Change its caption to: "off"
  10. Double-click the "on" button and add the following code:
    picture1.visible=true
  11. Double-click the "off" button and add the following:
    picture1.visible=false
  12. Run your program!
  13. Make your picture turn three pictures on and off by repeating the code for each picture.