Objectives:
- Start working with Visual Basic
|
A Visual Basic Program to Turn Pictures On and Off with Buttons
- Create a new Visual Basic Project (Standard EXE).
- Click the picture icon on the toolbar and drag a picture box onto your form.
- Click on the picture property and select a picture from your folder.
- Change the visible property of the picture to false.
- Click on the label icon of the toolbar. And put a label on your form.
- Delete its caption from the caption property and type: "My Picture Project."
- 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!
Assignment
Create a Visual Basic program that consists of three pictures. Make on and off buttons for each picture.
<< Back to Skyline
|