Step 11: Run Your Program and Try Other Features
Your program is finished and ready to run. You can run your program and set the background color. To learn more, try to improve the program by changing the color of the form, customizing the buttons and check box, and changing the properties of the form.
For a video version of this topic, see Tutorial 1: Create a Picture Viewer in Visual Basic - Video 5 or Tutorial 1: Create a Picture Viewer in C# - Video 5.
To run your program and set the background color
Press F5 or click the Start Debugging toolbar button.
Before you open a picture, click the Set the background color button. The Color dialog box opens.
Select a color to set the PictureBox background color. Look closely at the backgroundButton_Click() method to understand how it works.
You can load a picture from the Internet by pasting its URL into the Open File dialog box. Try to find an image with a transparent background, so your background color shows.
Click the Clear the picture button to make sure it clears. Then, exit the program by clicking the Close button.
To try other features
Change the color of the form and the buttons using the BackColor property.
Customize your buttons and check box using the Font and ForeColor properties.
Change your form's FormBorderStyle and ControlBox properties.
Use your form's AcceptButton and CancelButton properties so that buttons are automatically clicked when the user presses the ENTER or ESC key. Make the program open the Open File dialog box when the user presses ENTER and close the box when the user presses ESC.
To continue or review
To go to the next tutorial, see Tutorial 2: Create a Maze.
To return to the previous tutorial step, see Step 10: Write Code for Additional Buttons and a Check Box.