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