Getting started with Visual Studio 2010: Running a Visual Basic Program

I recommend you to read how to open a visual basic project before reading the following tutorial

Let’s consider a sample visual basic program ‘Music Trivia’ for the demonstration. Music Trivia is a simple Visual Basic program designed to familiarize you with the programming tools in Visual Studio. The form you see now has been customized with five objects (two labels,a picture, and two buttons), and I’ve added three lines of program code to make the trivia program ask a simple question and display the appropriate answer. (The program “gives away” the answer now because it is currently in design mode, but the answer is hidden when you run the program.). For now, try running the program in the Visual Studio IDE.

Running the Music Trivia program

1. Click the Start Debugging button (the green right-pointing arrow) on the Standard toolbar to run the Music Trivia program in Visual Studio.

Tip: You can also press F5 or click the Start Debugging command on the Debug menu to run a program in the Visual Studio development environment.

Visual Studio loads and compiles the project into an assembly (a structured collection of modules, data, and manifest information for a program), prepares the program for testing or debugging, and then (if the compilation is successful) runs the program in the development environment. While the program is running, an icon for the program appears on the Windows taskbar. After a moment, you see the MusicTrivia form again, this time with the photograph and answer label hidden from view, as shown here:

image

Music Trivia now asks its important question: “What rock and roll instrument is often played with sharp, slapping thumb movements?”

2. Click the Answer button to reveal the solution to the question. The program displays the answer (The Bass Guitar) below the question and then displays a photograph of an obscure Seattle bass player demonstrating the technique, as shown here. The test program works.

image
3. Click Quit to close the program. The form closes, and the Visual Studio IDE becomes active again.
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...
 
Posts RSSComments RSSBack to top
© 2013 Updated Tech News Results and Reviews