DCSA
DCSA
Unit 1
Lesson 1.1
Outcomes
6
Visual Programming
7
Introduction to visual studio 2008
Let‘s now explore some of the benefits of .NET Framework, which are as
follows:
i. Consistent programming model.
ii. Cross-platform support.
iii. Language interoperability.
iv. Automatic management of resources.
v. Ease of deployment.
vi. Code execution environment.
Above benefits of .NET Framework are describe bellow:
8
Visual Programming
9
Introduction to visual studio 2008
10
Visual Programming
Lesson 1.2
The languages include with visual studio are visual basic, Visual C++,
Visual C# (C sharp) and Visual J#. The above editions details are
described below:
11
Installation procedure of visual studio 2008
System Requirements
The various hardware and software requirements that are needed to install
the visual studio 2008 are given below:
SL. No Hardware and software Requirements
Installation process
The following are the steps to be taken to install visual studio 2008:
12
Visual Programming
Step 1: insert the DVD of visual studio 2008 in the DVD-ROM drive.
The visual studio 2008 setup wizard appears as follows:
Step 2: Now click on the Install Visual Studio 2008 link, as shown in
Figure 1. The setup wizard will start copying needed files into temporary
folder. Here you should just wait few times. The Visual Studio 2008
installation starts as follows:
Step 3: After few seconds a welcome setup wizard will appear look like
the following:
13
Installation procedure of visual studio 2008
Step 4: Now just click the Next button to go to the next step. Now you
will look like the following screen:
Step 5: Now Select the radio button beside the I have read and accept the
license terms option, as shown in Figure 4 and then click next button to
continue. A new option page appears as shown in Figure 5:
14
Visual Programming
Step 6: Now select the Full radio button as shown in Figure 5, because
we are going to install full features of visual studio 2008. If you want you
can select any one of the radio buttons. Now just click Install button as
shown in Figure 5. After clicking install button the visual studio 2008
stats installation and following screen will appear:
15
Installation procedure of visual studio 2008
Step 9: Now just click the Finish button to complete installation as shown
in Figure 7.
16
Visual Programming
Lesson 1.3-1.5
17
Installation procedure of visual studio 2008
Step 3: After a few minutes you will look the following window:
18
Visual Programming
Step 4: On the Start Page of Visual Studio, you will see the following
panes:
i. Recent project.
ii. MSDN: Visual Studio.
iii. Getting started.
iv. Visual Studio Headlines.
Recent project: Here you see a list of the projects you opened most
recently with Visual Studio, and you can select the one you want to open
again— chances are that you will continue working on the same project
as the last time. Each project‘s name is a hyperlink, and you can open it
by clicking its name. At the bottom of the Recent Projects section are two
hyperlinks, for opening or creating another project.
Menu Bar: The menu bar of the visual studio IDE provides different
menus for different Visual Studio commands as shown in figure:
19
Installation procedure of visual studio 2008
menus, or other input or output elements are placed. Toolbars are shortcut
to the most frequently performed actions. You will find several common
toolbars on the visual studio IDE such as Standard, Layout, Formatting,
Debug etc. as shown in following Figure:
Figure 4: Toolbars
Toolbox: The toolbox contains a number of tabs and each tab contains a
list of controls and components that can be placed on a form. The toolbox
is docked on the left side of the IDE. If it is not visible, you can bring
toolbox from the View menu or press the CTRL+ALT+X keys together to
open it. The Toolbox is shown in following Figure:
From the Toolbox, it is seen that the Toolbox uses tabs, such as all
windows Forms, Common Controls, Containers, Menus & Toolbars,
Data, Components, Printing, Dialogs, WPF interoperability, Reporting,
Visual Basic PowerPacks and General to categorize different controls and
components.
20
Visual Programming
Code Editor: If you select Code View within the Project Window, or if
you double-click on a control icon within the Form Design Window, the
Code Editor Window will open, displaying the Visual Basic code
associated with a particular object. You use the Code Editor Window to
write, display, and edit Visual Basic code. You can press F7 key to switch
from windows Forms Designer to the code editor. On the other hand you
can switch Code editor by selecting View Code. You must write the
Code between Class. Code editor is shown in following Figure:
21
Installation procedure of visual studio 2008
22
Visual Programming
studio IDE. If it is hidden, you can active solution explorer in the IDE,
click on View Solution Explorer or press CTRL+ALT+L keys together.
The solution explorer gives you a graphical representation of all the files
that make up your project. When you double click on any file in your
project from the solution explorer, it opens quickly. The Solution
Explorer window and the Window‘s title bar hold the name of your
solution (.sln) file, which is WindowsApplication1 by default unless you
give it a new value in the New Project dialog box. The following Figure
shows a solution explorer window:
23
Installation procedure of visual studio 2008
Tip
Server Explorer: The server explorer window allows you to view the
various services that are available on a specific server. It is a powerful
tool that provides drags and drop feature. Server explorer helps you to
work with database in easy way. It is a sever management console for
visual studio. You can use the server explorer to list database tables,
views, stored procedures, and functions. If Crystal Reports is installed on
your computer, you can create a report directly from server explorer.
Using server explorer, you can view and manipulate data link, database
connections, and system resources on any server, which is connected to
the network. By default server explorer contains two nodes such as i)
Data Connections and ii) Servers. To view the server explorer, click on
the ViewServer Explorer or press CTRL+ALT+S keys together. The
server explorer window is shown in following Figure:
24
Visual Programming
Output Window: The output window displays the result of building and
executing applications. By default the output window shows at the bottom
of the visual studio IDE. If it is hidden, to view the output window, click
View Output or by pressing CTRL+ALT+O keys together. The output
window is shown in following window:
Error window: The error window displays the various types of error
such as syntax error, typing error, variable declaration error etc
automatically. When you type the code on editor, if it is an error, it will
display automatically on Error window as error list. The error list displays
error with details that is its description, file number, line number, column
number and project name. To view the error list, click ViewError List
or by pressing CTRL+E keys together. the error window is shown in
following Figure:
Errors: This option displays the number of errors in the list. Click this
option to see whether errors are displayed
Messages: This option displays the number of messages in the list. Click
this option to see whether messages are displayed.
25
Installation procedure of visual studio 2008
Lesson 1.6-1.8
Step1: On the Windows taskbar, click Start, click All Programs, and then
click the Microsoft Visual Studio 2008 Folder then Click the Microsoft
Visual Studio 2008 icon for windows 7.
For windows 7:
StartAll ProgramsMicrosoft Visual Studio 2008 Folder Microsoft
Visual Studio 2008 icon.
For windows XP:
Start Microsoft Visual Studio 2008Microsoft Visual Studio 2008
icon
You will see the following figure:
26
Visual Programming
Step 1: Start visual studio according to above step, you will look like
following figure:
27
Installation procedure of visual studio 2008
Step 3: After Clicking Project or New Project option you will look like
following window:
Step 4: Now select Windows option under Visual Basic as project Types
from the left pan of the window. Then select Windows Forms Application
template. Now give project name on the name text field as Firstvbproject
then click ok button, which is shown in figure 4. Now you will look like
the following Figure:
28
Visual Programming
Step 6: Now drag a TextBox control from the Toolbox and drop it on
Form1, which is shown in following figure:
Step 7: Now drag a Button control from the Toolbox and drop it on
Form1, which is shown in following Figure:
29
Installation procedure of visual studio 2008
Step 8: Now single click on TextBox of the Form1 and increase it either
left or right using cursor, which is shown in following figure:
Figure 8: Visual Studio IDE with a TextBox and Button control after
increasing TextBox
Step 9: Now double click on Button1 control of the Form1, you will see
the following window:
30
Visual Programming
End Sub
Step 10: Now type the following code before End Sub. When you start
type code a dropdown window will be appeared as like following figure:
31
Installation procedure of visual studio 2008
Step 10: Now for saving project, click File, then click Save All or press
FileSave All
Here, you can change your project name, location etc. By default your
project will save on C drive. If you want to change your location just
click on browse button and select location from your computer. Now, just
click on save button. The project will save your selected location.
Step 11: Now for running your project, click on Debug Start
Debugging from Menu bar or press F5 key or click on icon from
toolbar. Now you will look like following figure:
32
Visual Programming
Step 12: After running the program just click on Button1 then you will
look the text ‗Bangladesh Open University‘ on textbox of Form1, which
is shown in following figure:
33
Customizing windows forms
Lesson 1.9
Outcomes
34
Visual Programming
Step 3: Now we will give form name. So, just single click on Form1.vb
under Solution Explorer window, and give the name ‗frmlogin‘ as like
following:
Step 4: Now we will change the text of from. So, just single click on
windows form and change the property of form from the right side
property panel. Now change the text property of form as like following:
35
Customizing windows forms
Tip
Step 5: Now change the form ControlBox property from the properties
panel. By default, it is selected as True. Now you change it as False as
follows:
36
Visual Programming
Step 6: Now we want to change the form backcolor. So change the form
backcolor property from the properties panel. When you select the
backcolor property, you will look three color tabs such as Custom, Web,
and System. You can select any type of color from this tabs which you
want. Now select web tabs, and select tomato color which looks like the
following:
37
Customizing windows forms
If the Properties window is not visible, you can choose View / Properties
Window from the menu or press the F4 shortcut key to show it.
Tip
Step 7: Now save all the projects by clicking on save all icon from
the toolbar.
38
Visual Programming
Step 8: Now run the program or form by clicking on run icon from
the toolbar. You will look like the following:
Step 9: Now for stop the running program, just click on Stop
debugging icon from toolbar.
39
Customizing windows forms
Assessment
MCQ
1. To save all the project‘s files, select _______
Assessment a) Save > Solution > Save Files b)File > Save
c) File > Save All d)File > Save As….
2. The Form‘s property specifies the text that is displayed in the Form‘s
title bar.
a) Title b)Text
c) (Name) d)Name
3. Property specifies how text is aligned within a Label‘s boundaries.
a) Alignment b)AlignText
c) Align d)TextAlign
4. In which mode, the application is executing.
a) start b) run
c) break d) design.
Exercise
1. Write the purpose of the following file types in Visual Basic
i) .vb ii) .frm iii).exe
2. What are the advantages that visual basic have, which makes it an
excellent programming tool?
3. What is IDE? Discus the following components of IDE i.e. Project
Window, Property window, Form Window and Code Editor Window.
40
Visual Programming
41