VB Notes1
VB Notes1
What is Vb.net?
VB.Net is a simple, modern, object-oriented computer programming language developed by
Microsoft to combine the power of .NET Framework and the common language runtime with
the productivity benefits that are the advance of Visual Basic. Visualbasics is a language ..net
is a platform
1 II BCA-III Sem/VB.net 1
Menu bar –Visual Basic and have seen the Start page, you often turn to the menu system to
proceed, as when you want to create a new project and use the File|New|Project menu item to
bring up the New Project dialog box
The IDE menu system is very involved, with many items to choose from-and you don't even
see it all at once.
The menu system changes as you make selections in the rest of the IDE-for example, the Project
menu will display 16 items if you first select a project in the Solution Explorer, but only 4 items
if you have selected a solution, not a project.
There are hundreds of menu items here, and many useful ones that will quickly become
favorites, such as File|New| and you can access from the Recent Files or Recent Projects items
near the bottom of the File menu.
it includes file, edit, view, project, build, debug, data, format, tools, window, and help menu
Toolbar - The toolbars feature is another handy aspect of the IDE. These appear near the top
of the IDE. Toolbars provide a quick way to select menu items, it includes many buttons as
shortcuts for frequently used operations. Each button represents a command that can be selected
from a menu. Most toolbars’ buttons are displayed in the main window of the IDE
Menu bar
Toolbar
2 II BCA-III Sem/VB.net 2
Graphical Designers
When you're working on a project that has user interface elements-such as forms, VB .NET can
display what those elements will look like at run time, and, of course, that's what makes Visual
Basic visual
There are several different types of graphical designers, including:
Windows form designers
Web form designers
Component designers
XML designers
Code Designers
code designers let you edit the code for a component, and you can see a code.You can use the
tabs at the top center of the IDE to switch between graphical designers.can also switch between
graphical and code designers using the Designer and Code items in the View menu, or you can
use the top two buttons at left in the Solution Explorer.
IntelliSense
One useful feature of VB .NET code designers is Microsoft's IntelliSense.
IntelliSense is what's responsible for those boxes that open as you write your code,
listing all the possible options and even completing your typing for you.
IntelliSense is one of the first things you encounter when you use VB .NET
IntelliSense is made up of a number of options, including:
o List Members-Lists the members of an object.
o Parameter Info-Lists the arguments of procedure calls.
o Quick Info-Displays information in tool tips as the mouse rests on elements in
your code.
o Complete Word-Completes typed words.
o Automatic Brace Matching-Adds parentheses or braces as needed.
3 II BCA-III Sem/VB.net 3
Object Explorer
IntelliSense is useful because it tells you what syntax is correct automatically, or lists all
the members of an object that are available.
Another useful tool that's too often overlooked by Visual Basic programmers is the
Object Explorer.
This tool lets you look at all the members of an object at once, which is invaluable to
pry into the heart of object you've added to your code.
The Object Explorer helps open up any mysterious objects that Visual Basic has added
to your code so you can see what's going on inside.
The Object Explorer shows all the objects in your program and gives you access to
what's going on in all of them.
By selecting it into the View menu, it's possible to explore all the available objects of
the libraries
Solution Explorer in Visual Basic.net 2008 contains lists of all the files associated with
a project. It is docked on the right under the Toolbar in the VB IDE
Solution Explorer has options to view the code, form design, refresh listed files. Projects
files are displayed in a drop down tree like structure, widely used in Windows based
GUI applications.
You can set the properties of various items in a project by selecting them in the Solution
Explorer and then setting their properties in the properties window.
And you can set properties of solutions and projects by right-clicking them and selecting
the Properties item in the menu that appears, or you can select an item and click the
properties button, which is the right-most button at the top of the Solutions Explorer.
VB .NET IDE depends on which solution or project is the current one, and you set that
by selecting it in the Solution Explorer.
The Solution Explorer tracks the items in your projects; to add new items, you can use
the menu items in the Project menu, such as Add Windows Form and Add User Control.
To add new empty modules and classes to a project (we'll see what these terms mean
in detail in the next chapter), you can use the Project|Add New Items menu item.
Solution
Explorer
Tool box
4 II BCA-III Sem/VB.net 4
Toolbox contains different tools for your controls
The toolbox uses tabs to divide its contents into categories; you can see these tabs,
marked Data, Components, Windows Forms, and General. The tabs available, as you
might surmise, depend on the type of project you're working on-and even what type of
designer you're working with. When you're working on a Web form, you'll see Data,
Web Forms, Components, Components, HTML, Clipboard Ring, and General, and so
on.
The Data tab displays tools for creating datasets and making data connections, the
Windows Forms tab displays tools for adding controls to Windows forms, the Web
Forms tab displays tools for adding server controls to Web forms, and so on.
The General tab is empty by default, and is a place to store general components,
controls, and fragments of code in.
5 II BCA-III Sem/VB.net 5
The Class View Window
If you click the Class View tab under the Solution Explorer, you'll see the Class View window.
This view presents solutions and projects in terms of the classes they contain, and the members
of these classes.Using the class view window we can find the member of a class that we want
to work with
Using the Class View window gives you an easy way of jumping to a member of class that you
want to access quickly-just find it in the Class View window, and double-click it to bring it up
in a code designer.
6 II BCA-III Sem/VB.net 6
The Server Explorer
You use the Server Explorer, to explore what's going on in a server, and it's a great tool
to help make distant severs feel less distant, because you can see everything you need in
an easy graphical environment.
7 II BCA-III Sem/VB.net 7
Output window
Component tray
Select the folder labeled Visual Basic Projects in the Project Types box,and select the
Windows Application project type in the Templates box.
You also can name the new project—WinHello—and specify where to storeit.
Now click the OK button to create this new Visual Basic project.
The window you see at the centerlabeled Form1, is the window that will become our
new Windows application and this windows are called forms.
9 II BCA-III Sem/VB.net 9
In this case, I'll just add two Windows controls to this form—a text box and a button.
When you click the button, the application will display the text "Hello from Visual
Basic" in the text box.
Controls, of course, are user-interface elements that you see in Windows all the time,
such as list boxes, scroll bars, button, menus, and so on. To add a text box to Form1,
first make sure that the Visual Basic toolbox is open. You can see the toolbox to the left
of Form1
if you don't see the toolbox, select the View|Toolbox menu item to display it. Now click
the Windows Forms item in the toolbox so the toolbox displays the possible controls
you can use in Windows forms, such as text boxes, buttons, labels, link labels, and so
on.
In a move that's very familiar to Visual Basic programmers, you can now simply drag a
text box from the toolbox to Form1, or just double-click the TextBox entry in the
toolbox.
Give one example refer video for example
10 II BCA-III Sem/VB.net 10
To create a Web application, you need a Web server that uses the Microsoft Internet
Information Server (IIS) version 5.0 or later (with FrontPage extensions installed), and
that server must be running.
You can enter the location of your server in the Location box in the New Projects dialog
box; if you have IIS running on your local machine, Visual Basic will find it and use
that server by default)
When you click the OK button, Visual Basic will create the new Web application
Web applications looks much like designing Windows applications.
You can see a note in the Web form under design—called a page—at the center of the
IDE that says that we're using the Grid layout mode. In this mode, controls will stay
where you position them, just as they did when we created our Windows application
To close the application, just close the browser window.
Web application is remarkably similar to our Windows application, and that's the
primary inspiration behind VB .NET—bringing Visual Basic to the Internet.
Web applications such as this one use HTML to display their controls in a Web page, so
there are more limitations on those controls than on Windows controls, but as you can
see, the design process is very similar
11 II BCA-III Sem/VB.net 11
A console application, is an application that takes input and displays output at a
command line console with access to three basic data streams: standard input, standard
output and standarderror.
A console application facilitates the reading and writing of characters from a console -
either individually or as an entire line. A console application usually exists in the form
of a stand-alone executable file with minimal or no graphical user interface (GUI).
12 II BCA-III Sem/VB.net 12