Getting to know the IDE - Visual Basic .NET
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
This lesson as mentioned describes some of the most important Visual Studio features. It explains the most important windows, menus, and toolbars that make up the environment, and show how to customize them to suit your needs. In addition we gonna see some of the tools that provide help while you are writing Visual Basic applications and how to use the IDE to debug your programs.
Please notice that the Visual Studio IDE is extremely customizable which means that you can move, hide, or modify the menus, toolbars, and windows. You can create your own toolbars and then dock, undock, or rearrange them. Finally you can change the behavior of the built-in text editors and much more. However as beginner you should probably not customize the IDE's basic menus and toolbars too much because it will only cause confusion later.
NOTE: The screenshots in this tutorial may not look exactly like the ones on your system because of the OS and selected style. These screenshots were taken on a computer running Windows 8.1 so they display the Windows 8.1 look and feel. Also it may look different if you have chosen a different configuration (we assume you have configured VS for Visual Basic development).
1. The New Project dialog lets you start a new project.
Use the Project Types tree view on the left to select the project category that you want. After that select a specific project type on the right (as you see we have selected the Windows Forms Application project type). Finally set the location (default is My Documents), enter a name for the new project and click OK to create the project.
2. The Toolbox window displays tools that you could use with the currently active document.
These tools are available when you are editing an item that can contain objects such as controls and components.
By the way, these tools are grouped into sections callif you right-click a certain tab and select one of the commands in the context menu.
3. The Properties window allows you to view and modify the properties of the form and of the controls that it contains.
On our screenshot you may see the Properties window displaying properties for a Button control named ButtonLogin. You can see in the figure that the Text property of this control is "Login" and that's what the button displays to the user.
In addition please note the drop-down list at the top of the window. Well that list holds the names of all of the controls on the form. To select a certain control, you can either click it on the Designer or select it from this drop-down list.
The small icons below the dropdown determine what items are displayed in the window and how they are arranged. For example if you click the leftmost button, the window lists properties grouped by category and if you click the second icon that holds the letters A and Z, the window lists the control's properties alphabetically.
4. The Solution Explorer lets you manage the files associated with the current solution.
For example, in the Figure below, you could select LoginForm.vb in the Solution Explorer and then click the View Code button (the third icon from the right at the top of the Solution Explorer) to open the form's code editor.
You can also right-click an object in the Solution Explorer to get a list of appropriate commands for that object. This window makes it easier to find a command by right-clicking an object related to whatever you want to do than it is to wander through the menus.
5. The Error List window shows errors and warnings in the current project. For example, if the code contains invalid character, this list will say so.
It's extremly useful as it clearly tells you the type of the error(s) showing a full description, file name, line and everything else that helps you easily find and fix the error.
If you don't see the Error List it is probably hidden. You can display it by selecting the appropriate item in the View menu.
6. The Output window displays compilation results and output printed by the application.
Usually an application interacts with the user through its forms and dialog boxes, but it can display information here, usually to help you debug the code.
The Output window also shows informational messages generated by the IDE. For example, when you compile an application, the IDE sends messages here to tell you what it is doing and whether it succeeded.
7. The Windows Forms Designer allows you to design forms for typical Windows applications. It lets you add, size, and move controls on a form using your mouse.
Together with the Properties window, it lets you view and modify control properties, and create event handlers to interact with the controls.
8. You use the Visual Basic Code Editor to write a code that responds to control events.
The most obvious feature of the code editor is that it lets you type code, but the code editor is far more than a simple text editor such as Notepad.
It provides many features to make writing correct Visual Basic code much easier. For example you can create an event handler within the code editor. The upper left part of the code editor displays a drop-down listing all the controls.
If you select a control from the list, you can then pick an event for that control from a second dropdown in the code editor's upper right. If you select an event, the code editor generates a corresponding empty event handler for you.
To make referring to the code lines easier, code editor may display line numbers too.
To switch between design and code view:
To navigate from design to code view:
1. Right click anywhere in the Designer and select "View Code"
2. Open View menu and select "View Code"
3. Right-click the form in the Solution Explorer and select "View Code"
4. Use the hotkey "Ctrl + Alt + 0"
To navigate from code to design view:
1. Right click anywhere in the Code editor and select "View Designer"
2. Open View menu and select "View Designer"
3. Right-click the form in the Solution Explorer and select "View Designer"
4. Use the hotkey "Shift + F7"