Visual Basic Development 101: VS 2010 Part 2: Menus and Tools

Introduction to Microsoft Visual Studio 2010

In the last installment of Visual Basic .NET Development 101 we looked at a few basic steps to start programming with Visual Basic 2010 Express Edition. The last thing we mentioned was the Properties window and Solution Explorer window. By default, you'll only see the design surface on a tab named Form1.vb [Design] (see Figure 1). If you double-click on the button, you'll open a new tab showing the source code for Button1's event handler. For now, let's just type in one line of code to open up a message box when you click the button.

open up a message box when you click the button
Figure 1

When you start typing the letters "msg", you'll see another feature of Microsoft Visual Studio - Intellisense. This is Microsoft Visual Studio's way of helping you write code. It takes on many forms depending on your current context. When you're typing in code, it will give you a list of options to choose from. In this instance, you'll see MsgBox highlighted in the popup window. Microsoft Visual Studio will enter MsgBox for you if you hit the space bar or tab key. If you enter a left-parenthesis "(" you'll get the full MsgBox plus the parenthesis and be ready to type in the arguments. Figure 2 shows what you should see at this point.

the full MsgBox plus the parenthesis
Figure 2

Now we're ready to finish our first little program. Here's what you need to enter:

  Msgbox("Hello from Visual Basic 2010 Express")

At this point you have a fully functional Windows Forms application. All you have to do to run it is either click on the run icon (looks like a green play button) in the toolbar or press the F5 function key. The initial screen with our Click Me button will appear. If you click it, another smaller message box dialog will appear with our Hello message and an OK button (see Figure 3). To close the application you can either click on the red X in the top right-hand corner of the form or click on the Stop button (small blue square next to the run button) in the toolbar.

click on the red X in the top right-hand corner
Figure 3

A few more things need to be pointed out here before we move on. When the From1.vb tab is active, or has focus, you won't see anything in the designer toolbox as they don't apply to the current window. When you click on the design tab, the toolbox will repopulate. If you happen to close either of the windows, you can quickly reopen them from the Solution Explorer. The quickest way is to right-click on the Form1.vb item and choose either View Code or View Designer (see Figure 4). You could also use the F7 or Shift-F7 function keys as well.

choose either View Code or View Designer
Figure 4

Visual Basic 2010 Express will automatically save your project for you each time you run it. Every application has a number of default settings defined for you when you create a new project. You can change those by right-clicking on the WindowsApplication1 project name in the Solution Explorer and choosing Properties. It's also available from the Project menu under WindowsApplication1 Properties. The title will change with the name of your application.

WindowsApplication1 Properties
Figure 5

Summary

Microsoft Visual Studio 2010 has a world of other options and features, but we'll address them as they come up along the way. For now, you have enough information to create a few simple applications on your own so go ahead and get started!



Related Articles

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Mobile is introducing sweeping changes throughout your workplace. As a senior stakeholder driving mobile initiatives in your organization, you may be lost in a sea of technologies and claims from vendors promising rapid delivery of applications to your employees, customers, and partners. To help explain some of the topics you will need to be aware of, and to separate the must-haves from the nice-to-haves, this reference guide can help you with applying a mobile strategy in the context of application …

  • As a development and deployment platform, RHEL offers an efficient, scalable, and robust operating environment with certified security and flexible deployment options in physical and virtualized environments. To assess and quantify the business benefits of RHEL, IDC recently conducted in-depth interviews with IT staff members of 21 companies using RHEL servers. The organizations represent a broad range of industries and have an average of 22,700 employees. RHEL servers accounted for 23% of the servers …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds