Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 1 - Writing Your First Program

By Dan Mabbutt, About.com

7 of 8

Getting Ready To Code - A Look At Some VB.NET Code!

View Code in Solution Explorer

'View Code' in Solution Explorer

The rest of Chapter 1 is all about modifying Properties in the first practice project supplied on the CD with the book, MusicTrivia. But since we're moving on to the creation of our own project in the next chapter, it would be a shame to leave this chapter without also checking out the code in the MusicTrivia project. So let's do that now.

After you have changed the Properties as suggested in the book, make sure that Solution Explorer is visible as shown above and then right-click the MusicTrivia.vb file to display the Context Menu and select View Code. You should see this code. (Note: the two Sub statements have been reformatted to make them fit the web page.)

~~~~~~~~~~~~~~~~~~~~~~~~~
Public Class Form1
  Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

  Private Sub Button1_Click
  (ByVal sender As System.Object,
  ByVal e As System.EventArgs)
  Handles Button1.Click
    Label2().Visible = True
    PictureBox1().Visible = True
  End Sub

  Private Sub Button2_Click
  (ByVal sender As System.Object,
  ByVal e As System.EventArgs)
  Handles Button2.Click
    End
  End Sub
End Class
~~~~~~~~~~~~~~~~~~~~~~~~~

Explore Visual Basic

By Category

About.com Special Features

Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Writing Your First Program

©2009 About.com, a part of The New York Times Company.

All rights reserved.