SeasonsSeasons

We will end the lesson on code by writing a program that displays a picture and information about each season. Start a new windows application named Seasons. Right click on each picture and save it to your computer:
fall winterspringsummer

Build the form as shown below:

Double-Click on BtnSpring to open the code view window. Write the code as shown below:

  Private Sub BtnSpring_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSpring.Click
     Me.BackColor = sender.backcolor
     Me.PicSpring.Visible = True
     Me.PicSummer.Visible = False
     Me.PicFall.Visible = False
     Me.PicWinter.Visible = False
     Me.LblMessage.Text = "Spring: The snow melts and flowers bloom."
  End Sub 'BtnSpring_Click
Finish the program by copying the code and pasting it for each button, then modify.
INDEX, The Code View, Selecting code from list, Events, Arguments, Concatenation, Sender, Scroll Bars, Decimal Values on Scroll Bar, Picture Boxes: the Seasons, Comments, Printing, Closing
Next lesson: Functions in Visual Basic

Copyright © Zebra0.com
All rights reserved worldwide.

 
 

Picture Boxes: the Seasons