Title: WebEnabled Decision Support Systems
1Web-Enabled Decision Support Systems
- Introduction to Visual Studio
Prof. Name
name_at_email.com Position
(123) 456-7890 University Name
2Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
3Introduction
- Visual Studio is an Integrated Development
Environment (IDE) - Used to develop, debug, and deploy various
applications - We will use it with the Visual Basic .NET (VB
.NET) programming language - Database applications are computer programs that
allow users to manipulate the data in a DBMS
through a user-friendly interface - Broadens perception of information
- Enhances the efficiency of data editing,
processing, and printing operations - Application platforms
- Windows based (for a single user)
- Web based (for multiple users)
4Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
5Exploring Visual Studio IDE
- Visual Studio is Microsofts development tool for
Windows-based and web-based applications - Facilitates the process of design, development,
debugging, and deployment - Package includes
- Component-based development tools Visual Basic,
Visual C, Visual C, J - Other supporting technologies
- The Integrated Development Environment (IDE) is a
powerful and sophisticated tool with a wealth of
features for application development - Integrates and manages development tools under
one single window or environment
6The Start Page
- On start up, Visual Studio displays the tabbed
Start Page
Visual Studio Start Page
7Project Selection
- To open an existing project
- Choose File Open Project from the Main menu.
- To create a new project
- Choose File New Project from the Main menu.
- We now start developing our first Windows
application - A single-form that greets the user by displaying
a welcome message accompanied by a graphic image
8Creating a New Application
- How-to Create a New Visual Basic Windows
Application - From the Start Page, click Create Project.
Select the Visual Basic option under the Projects
types, and then choose the Windows Application
icon under the Templates area. Name the project
FirstProgram and click OK.
The New Project Dialog Box
9Visual Studio IDE
- At this point, the screen should resemble below
Visual Studio IDE
10The Design Window
- The Design Window consists of tabbed documents
- Each form is displayed as a separate tab
- Example Form1.vb Design
- The active tab is always positioned in front of
all other tabs and is displayed with a boldface
name - The tab system saves a lot of space and allows
easy access to multiple documents
11The Main Menu
- Main Menu features
- File Creates, opens, saves, and closes projects
- View Allows us to quickly open various IDE
windows - Project Facilitates addition of new items to the
current project - Build Compiles, builds, and runs the project
- Debug Allows us to debug the current project
- Tools Used to configure the Visual Studio IDE
Visual Studio Main Menu
12The Toolbar
- Toolbar features
- Solution Explorer
- Opens the Solution Explorer Window
- Property Window
- Opens the Property Window
- ToolBox
- Opens the ToolBox
Visual Studio Toolbar
13Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
14Visual Studio IDE Windows
- The Visual Studio IDE consists of various windows
that assist in the application development
process - Solution Explorer Window
- ToolBox
- Property Window
- Server Explorer
- Window Properties
- Accessible from the View menu and toolbar buttons
- May be docked along the edges of the Visual
Studio Window - Auto-hide feature
- Balances the design space and the availability of
IDE tools - Use the small-pin icon to enable
15The Solution Explorer Window
- The Solution Explorer Window gives us a
hierarchical view of all the files that belong to
the current project - Provides access to all the files and components
of the project
The Solution Explorer Window for the
FirstProgram Application
16The Toolbox
- The ToolBox contains a set of reusable components
called controls - Groups the controls together and arranges them by
group name - Examples All Windows Forms, Common Controls,
Data, Crystal Reports - Visual Programming is a programming paradigm in
which we add visual components to build
applications without writing much code - An object is any element that can be named and
has some specific purpose - Windows forms, ToolBox controls, Toolbars, the
Main Menu, etc.
17Adding Controls to a Form
- How-to Add a Windows Control from the ToolBox to
a Form - Click the desired control in the ToolBox. Place
the mouse pointer on the form at the desired
control position. - Drag the pointer to designate the desired size of
the control.
Adding a Control Object to the Form
18The Properties Window
- Properties are attributes of an object
- The Property Window displays a list of properties
for a selected object - Used to manipulate the appearance and behavior of
an object - Top box
- Name of the selected object (lblTitle)
- Middle Icons
- Controls to sort by category or alphabetical
order - Lower box
- Property names and values
19Adding and Modifying a Label Control
- The following is a continuation of the How-to,
Create a New Visual Basic Windows Application - Add a Label control to Form1.
- Use the Properties Window to change the Label
control properties as listed below - Name lblTitle
- Text Welcome to the World of Programming
- Text Align Middle Center
- Fore Color Navy
- Font Georgia, Bold, 14
- Use the drop-down button to select the property
values for Text Align and Fore Color, and use the
ellipsis button at the end to open the Font
dialog box. Set the Font, Font Style, and Size
values.
20Visually Modifying Label Properties
Properties Window
Forecolor
Text Align
Font
21Modifying Form Properties
- Select the form itself so that we can view its
properties. Change its properties as listed
below - Text First Form
- BackColor 255,128,0 (Orange)
22Adding a PictureBox Control
- Add the PictureBox control to the form. Select
and manipulate the PictureBox properties using
the guidelines below - Cursor Hand
- Image System.Drawing.Bitmap
- Name imgSample
PictureBox Properties
Adding PictureBox Control
23Running the Application
- Visual Studio compiles and runs an application to
produce its output - How-to Run an Application
- From the Main menu, choose Debug Start Without
Debugging. - Run the application. Close the running form to
return to the Design Window.
Running an Application Using the Debug Menu
24The Running Form
The Running FirstProgram Application
25The Server Explorer Window
- The Server Explorer Window gives access to the
available servers - A server is a piece of software that provides
some service - Example
- An Access database
The Server Explorer Window
26The Help Menu
- Visual Studio has an excellent online help
feature that provides assistance to developers - The Help menu has four main menus
- Content
- Displays articles that are categorized by topic
- Index
- Displays help topics organized alphabetically
- Search
- Finds and displays help topics based on the
search keyword - Dynamic Help
- Offers a list of help topics specific to the
users current tasks and needs in the IDE
The Help Menu
27Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
28Object-Naming Conventions
- We follow naming conventions in order to manage
an application that features an increasing number
of objects - Naming should be logical
- Names should start with a capital letter
- While names can include any number of digits,
they cannot start with a digit - Every object name should have a prefix (three
lower case letters) indicating the type of
object
Naming Standards
29The File Extensions
- The table below gives brief summary of the most
common file extensions used by a Visual Basic
application
A Few Commonly Encountered File Extensions
30Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
31A Look at the VB .NETs Code Window
- The Code Window is Visual Basics programming
environment - Invoke by double-clicking anywhere on a form
The Code Window
32VB .NET Programming
- Visual Basic programs control flow is designed
around a users actions - Examples
- Loading of a form
- Clicking of a button
- Entering of text
- Visual Basic events are triggered by actions
- Event-driven programming involves writing code
designed to handle these events - Visual Basic provides a rich set of events
associated with each Windows control
33Adding Event Code
- How-to Add Event Code to the PictureBox Control
- Open the Code Window for the PictureBox control,
imgSample, and associate the following code
with its Click event. - Run the application and verify the output by
clicking on the image.
Code for the Click Event of the PictureBox
Control
34Understanding the Code
- The keyword sub marks the beginning of an event
subroutine - The name of an event subroutine is a combination
of the control name and the type of the event - Example imgSample_Click
- Each subroutine has a fixed syntax
- Starts with Private Sub ltnamegt
- Ends with End Sub
- Visual Basic automatically executes the code
inside the event subroutine every time the event
is triggered - The property manipulation in the Code Window is
visible only at the run-time - The property manipulation in the Property Window
is visible at the design-time as well as at
run-time (until changed)
35Additional Features of the Code Window
- The Code Window makes it easy to add an event
other than a default event for an object - The top portion of the Code Window has two
drop-down boxes - The left box lists the available objects
- The right box lists all possible methods and
events for the object in the left box
Class and Method Selection in the Code Window
36IntelliSense and Code Tips
- IDE provides two forms of help to assist the
code-writing process - IntelliSense
- When we use the dot (.) operator immediately
after an object name, the IDE displays a list of
properties and methods associated with that
object - Code Tips
- When a property or method for an object has been
selected, IDE displays the exact syntax (command
structure) of a selected method/event
Code Tip
IntelliSense
37Saving the Work
- Each unsaved tab in the IDE shows an asterisk ()
- To save work, choose the File Save Project or
File Save All option from the Main menu.
Saving the Work
38Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
39The Object Browser
- The Object Browser serves as a dictionary of .NET
objects - Allows us to quickly access information about
various objects - Lists all possible classes, built-in objects,
methods, events, and more - Appears as a separate tab in the IDE window
Object Browser Window
40Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
41In-Class Assignment
- This in-class assignment further extends the
application developed in this chapter - The simple extension is as follows
- We would like to close the form (running
application) on the click of the Close button.
42Overview
- 10.1 Introduction
- 10.2 Exploring Visual Studio IDE
- 10.3 Visual Studio IDE Windows
- 10.4 Object-Naming Conventions
- 10.5 A Look at the VB .NETs Code Window
- 10.6 The Object Browser
- 10.7 In-Class Assignment
- 10.8 Summary
43Summary
- Visual Studio .NET integrates its development
tools under one environment known as Integrated
Development Environment (IDE) - The IDE is a powerful tool that provides a wealth
of features for the application development
process - The Design Window is one part of the IDE
- Allows the user to graphically manipulate the
design of a form and other controls
44Summary (cont.)
- Visual Studio .NET IDE is made up of various
windows that assist in the process of application
development - The Solution Explorer Window displays a
hierarchical view of the solution - The ToolBox is the container for reusable
components called controls - The Properties Window displays the property list
for a selected object - The Server Explorer Window provides access to the
available servers - The Dynamic Help Window provides a list of help
topics related to the current content of the IDE - The Object Browser is a dictionary of .NET
objects