In this session, you will learn to:Appreciate the Graphical User Interface (GUI)
Identify the controls of GUI
Objectives
Appreciate the Graphical User Interface
What is a user interface?
Appreciate the Graphical User Interface (Contd.)
An interface is a layer between a user and an application. It helps the user to interact with the
application.
The two types of user interface are:Character User Interface (CUI)
Graphical User Interface (GUI)
Appreciate the Graphical User Interface (Contd.)
Enter your name: John
Enter a book name: Famous Five
Sorry, The book is not available.
Do you want to check for another book (y/n):
In CUI, the user interacts with an application by typing commands.
The following figure shows the sample output of a CUI application.
A GUI provides a picture-oriented or graphical way of interacting with an application.
The following figure shows a sample output of a GUI application.
Advantages of GUI applications are:They are easy to learn and use.
The users need not remember the lines of syntax.
Most of the commands are executed by using mouse.
Appreciate the Graphical User Interface (Contd.)
A GUI application interacts with the users through various components, called controls.
The following figure shows a GUI screen containing various controls.
Identifying the Controls of GUI
Label
Text Box
Button
Combo Box
Just a minute
A ____________ is a control that consists of other controls.
Answer:Container
Windows provides the following types of dialog boxes:Modal
System modal
Modeless
Identifying the Controls of GUI (Contd.)
Modal: It does not allow the user to switch focus to another area of the application, which has invoked the dialog box.
It allows the user to switch to other Windows applications.
The Save As dialog box of Microsoft Word is an example of modal dialog box.
Identifying the Controls of GUI (Contd.)
The following figure shows the Save As dialog box.
Identifying the Controls of GUI (Contd.)
System modal:It takes control of the entire Windows environment.
It does not allow the user to switch to any other Windows application until it is closed.
The Log On to Windows dialog box is an example of system modal dialog box.
Identifying the Controls of GUI (Contd.)
The following figure shows the Log On to Windows dialog box.
Identifying the Controls of GUI (Contd.)
Modeless:
It allows the users to switch to another area of the application or to another Windows application.
It remains on the screen and is available for use at any time.
The Find and Replace dialog box of Microsoft Word is an example of modeless dialog box.
Identifying the Controls of GUI (Contd.)
The following figure shows the Find and Replace dialog box.
Identifying the Controls of GUI (Contd.)
Just a minute
Which dialog box allows users to switch to another area of the application, which has invoked it?
Answer:Modeless dialog box
Just a minute
A __________ acts as a container for a group of related controls.
Answer:Dialog box
Identifying the Features of the Windows Environment
The features of the Windows environment that enable applications to interact effectively with the user are:
Event-driven programming
Dynamic linking
Identifying the Features of the Windows Environment (Contd.)
Event-driven programming:Windows application can execute programs on a click of a mouse. An event is an action performed by the user.
Windows applications generate messages in response to each action performed by the user.
Depending on the messages received, the application performs preprogrammed functions.
Based on user’s input, an event gets generated. The code corresponding to the event is executed.
Identifying the Features of the Windows Environment (Contd.)
Dynamic linking:The process by which an application is linked to the library functions at run time.
The reference to the function is looked up at run time. This is called dynamic linking.
In this session, you learned that:GUI enables the users to interact with the application by using graphical components.
Windows provides three types of dialog boxes: Modal dialog box
System modal dialog box
Modeless dialog box
The main features of the Windows environment are:Event-driven programming
Dynamic linking
Summary
In this session, you will learn to:Identify the features of .NET Framework
Objectives
Identifying the Features of .NET Framework
What is .NET Framework?
Identifying the Features of .NET Framework (Contd.)
.NET Framework is an integrated technology that
helps in creating and running robust, scalable,
and distributed applications.
Microsoft introduced the .NET Framework to enhance the interoperability of applications.
The .NET Framework is designed to make improvements in:Code reuse
Code specialization
Resource management
Multilanguage development
Security
Deployment
Administration
Identifying the Features of .NET Framework (Contd.)
.NET Framework offers a complete suite for developing and deploying applications.
The suit consists of:
.NET Products
.NET Services
.NET Framework
Identifying the Features of .NET Framework (Contd.)
The following figure shows the different components of the .NET Framework.
Components of the .NET Framework
CLR is the environment in which
all programs that use .NET technologies are executed.
The CLR allows the execution of code across different
platforms by translating code into
Intermediate Language (IL).
At the presentation layer, .NET
provides three types of user interfaces. They are
Windows Forms, Web Forms, and Console Applications.
The .NET Framework class library works with any .NET language, such as VB.NET, VC++ .NET, and VC#.
The .NET Framework class library comprises namespaces, which
are contained within assemblies.
Identifying the process of compilation:Compilation is the process of creating an executable program from the source code. It converts source code into machine language.
In .NET, the conversion of source code to machine language takes place in two stages:
In the first stage, the compiler translates code into an IL instead of machine language or assembly language.
In the second stage, the JIT compiler converts IL into machine language at run time.
Components of the .NET Framework (Contd.)
The following figure shows the process of code compilation.
Components of the .NET Framework (Contd.)
Program CodeCompiler
IL Metadata
Assembly
+
Machine CodeJIT Compiler
Identifying the process of code execution:During execution, CLR performs the following steps:
Loading assemblies and identifying namespaces
JIT compilation
Garbage collection
Components of the .NET Framework (Contd.)
The following figure shows the process of code compilation.
Components of the .NET Framework (Contd.)
SetTopScore()
IgnoreScore()
SetTopScore()
Visual C# Code IL Code
IgnoreScore()
The following figure shows the process of code execution.
Components of the .NET Framework (Contd.)
JIT
SetTopScore()
IgnoreScore()
SetTopScore()
Machine LanguageIL Code
is invoked
SetTopScore()
The following advantages are offered by the .NET Framework:
Consistent programming model: The .NET Framework provides a common object-oriented programming model across languages.
Multi-platform applications: A .NET application can be executed on any platform and architecture supported by CLR.
Multi-language integration: .The NET Framework allows integration of multiple languages. You can create a VC# class deriving from a VB.NET class.
Automatic resource management: The CLR tracks resource usage and relieves a programmer from the task of manual resource management.
Ease of deployment: .NET applications can be deployed simply by copying files to the target computer.
Components of the .NET Framework (Contd.)
In this session, you learned that:.NET Framework is made up of many components, such as CLS, CLR, and JIT compiler.
The CLR is the environment where all .NET applications are executed.
CLS is a set of rules that are followed by all the languages of the .NET Framework.
When a program is compiled by using Visual Studio, the compiler translates the code into IL instead of machine language.
The JIT compiler is used to translate the code from IL into machine language.
Summary
In this session, you will learn to:Use Windows project by using Visual Studio .NET integrated development environment
Objectives
The Visual Studio .NET IDE provides you with a common interface for developing various kinds of applications.
The IDE also provides you with a centralized location for:Designing the user interface for an application.
Writing code for the application.
Compiling the application.
Debugging the application.
Using Visual Studio .NET IDE
In Visual Studio .NET, an application can be made up of one or more items, such as files and folders.
To organize these items efficiently, Visual Studio .NET provides two types of containers:
Projects
Solutions
Creating Projects and Solutions
Project: It contains interrelated items that make up the application.
It allows you to manage, build, and debug the items.
An executable file (.exe) or a Dynamic Link Library (.dll) is created when you build a project. These files are called the project output.
Solution: It acts as a container for one or more projects.
It allows you to work on multiple projects within the same instance of the Visual Studio .NET IDE.
Creating Projects and Solutions (Contd.)
The following figure shows a solution containing multiple projects.
Creating Projects and Solutions (Contd.)
Solution
Project 1
Project 2
Miscellaneous Files
Project 1Items
Project 2Items
Creating Projects and Solutions (Contd.)
Let us see how to create a Windows application in Visual Studio .NET IDE.
The following table describes various templates available in the Templates pane.
Creating Projects and Solutions (Contd.)
Template Description
Windows Application It creates Windows-based application.
Class Library It creates a class or a reusable component (.dll or .exe) that exposes some functionality to be used in various projects.
Windows Control Library
It creates a custom control that can be added to the user interface.
Console Application It creates a CUI-based application that can run from the command prompt.
Device Application It creates a .NET Compact Framework 2.0 forms application for Pocket PC 2003 and later.
Crystal Reports Application
It adds a Windows user interface and a sample crystal report in the .NET application.
Just a minute
Which template creates a .NET Compact Framework 2.0 forms application for Pocket PC 2003 and later?1. Windows Control Library
2. Class Library
3. Device Application
4. Web Control Library
Answer:3. Device Application
Creating Projects and Solutions (Contd.)
Let us see various user interface elements of
Visual Studio .NET IDE.
The following figure shows various interface elements of Visual Studio .NET IDE.
Creating Projects and Solutions (Contd.)
Solution Explorer Window
Windows Form Designer
Toolbox WindowProperties Window
Output Window
Menu Bar
The following table describes various windows of Visual Studio .NET IDE.
Creating Projects and Solutions (Contd.)
Window Name Description
Output Window It displays messages regarding the status of various features provided in the Visual Studio. You can open it by selecting ViewOutput. Alternatively, you can use the key combination Ctrl+W, O.
Server Explorer Window
It is a tool used for various administrative tasks, such as monitoring the performance of other machines on a network, and locating and connecting to the various servers on the network. You can open it by selecting ViewServer Explorer. Alternatively, you can use the key combination CTRL+W, L.
Class View Window It displays the classes, methods, and properties associated with a particular file. You can open it by selecting ViewClass View. Alternatively, you can use the key combination Ctrl+W, C.
Dynamic Help Window
It provides you with context-sensitive help. You can open the dynamic help window by selecting HelpDynamic Help. Alternatively, you can use the key combination CTRL+F1, D.
Just a minute
Which window displays messages for the status of various features provided in the Visual Studio .NET IDE?
Answer:The Output Window
Just a minute
Which window allows to view the resources of the servers, such as services, processes, and the event log?
Answer:The Server Explorer window
Navigational Features in Visual Studio .NET IDE
The three navigational features provided by Visual Studio .NET IDE are:
Docking: Allows you to place a window against any of the edges of the parent window.
Tabbed: Allows overlapping of various open windows and navigating between them by using tabs.
Auto Hide: Automatically hides a window when it is not in use.
Navigational Features in Visual Studio .NET IDE (Contd.)
Let us see how to use various navigational
features provided by the Visual Studio .NET IDE.
Compiling and Executing a Project
Let us see how to compile and execute an
application.
In this session, you learned that:The Visual Studio 2005 IDE provides you with a common interface for developing various kinds of applications on the .NET Framework.
Some of the components of the Visual Studio .NET IDE are:The Windows Forms Designer
The Solution Explorer window
The Properties window
The Toolbox window
The Output window
The Code and Text Editor window
Summary
The Visual Studio .NET IDE also provides three navigational features. These are:
Docking
Tabbed
Auto hide
Summary (Contd.)
Let me give you some questions to solve at
home.
Home Assignment